Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

3d draw, setting perspective point, setting view point!

Tags:

java

opengl

I need to draw 3d projections and i am using opengl wrapper for JAVA. Problem: - how to set view point in java opengl (for examle i want to my program to draw object on screen like i am looking at that object from (0,0,0) ) - how to set perspective point(point in 3d where look is heading to, for example i want may program to draw object on screen as i am looking from (0, 0, 0) to (1, 1, 3) )

I am familiarized with mathematical problem of this question, so i have calculated all of the coordinates for perspectives. I just need opengl java function or set off functions that can draw this new coordinates in perspective i want.

HELP!! :)))

like image 598
shake Avatar asked Apr 22 '26 16:04

shake


2 Answers

Does this example help you? The function you are perhaps looking for is gluLookAt:

gluLookAt( GLdouble eyeX,
       GLdouble eyeY,
       GLdouble eyeZ,
       GLdouble centerX,
       GLdouble centerY,
       GLdouble centerZ,
       GLdouble upX,
       GLdouble upY,
       GLdouble upZ )

PARAMETERS
  eyeX, eyeY, eyeZ
      Specifies the position of the eye point.

  centerX, centerY, centerZ
      Specifies the position of the reference
          point.

  upX, upY, upZ   
          Specifies the direction of the up vector.
like image 128
schnaader Avatar answered Apr 25 '26 04:04

schnaader


Nehe have a port of most of their tutorials to Java. One of the first one should probably be doing what you need to get yourself started.

like image 41
shoosh Avatar answered Apr 25 '26 05:04

shoosh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!