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

I need to draw 3d projections and I use the opengl wrapper for JAVA. Problem: - how to set the viewpoint in java opengl (for example, I want my program to draw an object on the screen, as if I was looking at this object from (0,0,0)) - how to set the perspective point (point in 3d, where the title is drawn, for example, I want the program to be able to draw an object on the screen, as I look from (0, 0, 0) to (1, 1, 3))

I am familiar with the mathematical problem of this question, so I calculated all the coordinates for the perspectives. I just need the opengl java function or a function that can draw these new coordinates in the perspective I want.

HELP !! :)))

+3
source share
3 answers

Nehe have the port of most of their Java tutorials. Probably one of the first to do what you need to get started.

+1
source

Does this help an example ? The function you might be 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.
+2
source

Try this Java and OpenGL tutorial

Java Personal OpenGL Tutorial

0
source

Source: https://habr.com/ru/post/1706907/


All Articles