tags:

views:

389

answers:

4

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!! :)))

+2  A: 

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.
schnaader
tnx a lot!! This was very helpful..i when i found out function everything worked out..:))
shake
A: 

Try this tutorial on Java and OpenGL

Java Personal OpenGL Tutorial

Lazarus
Tnx. As i am new to this combination(java/opengl) this was helpfull. :))
shake
A: 

Thanks a lot. This is what i was looking for. :))

shake
Both aswers are very helpfull!!
shake
Rather than answer your own question it's better to add comments to the answers. There are now three answers, and we don't know which two you found helpful.
DJClayworth
+1  A: 

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.

shoosh