Q
Q
Quad_Tree2015-05-17 16:48:04
Java
Quad_Tree, 2015-05-17 16:48:04

Why does an object shake in OpenGL?

The object in my program moves according to the formula y = d * Math.cos(alpha); x = d * Math.sin(alpha);(where x is the distance from the center and alpha is the angle of rotation). The camera is following this object:

Camera.setPosition(new Vector3d(-object.getPosition().getX(), 0, -object.getPosition().getZ() + (7000.0 / 100000)));

All coordinates are considered in double, but at the same time, when approaching the object itself, the camera starts to shake (or the object, I can’t understand exactly). How to remove the inaccuracy in the coordinates from which everything is shaking.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Makaleks, 2015-05-18
@Makaleks

Does the Camera class use perspective?
It is possible that incorrect calculations occur all the time, but they become noticeable only when approaching (more noticeable) or with active movements at a distance (which will not be easy to notice with continuous movement).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question