Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I want to learn how I can track a moving object in OpenGL. The position of the object will be a continuous input. Also, what if when the object moves out of the screen?
You have to position and orient your camera towards the object. That means you will have to provide the correct View Matrix.
You can use functions such as gluLookAt() to generate a View Matrix that points towards a specific object.
If you don't know what a view matrix is, I suggest looking at this tutorial (http://learnopengl.com). Check out this page which explains cameras matrices work in openGL
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm facing this kind of problem: I would like to do something, when player isn't looking. For instance, like in SCP, move monster towards player. My question is: How can I check if player does see an object?
Assuming the player is in control of the camera. The camera has a front vector. Using that front vector and the normal of the object, in this case the monster, you can find out whether he is looking or not.
You can take the dot product of the object normal and the front vector. If it is negative or equal to 0, the angle is perpendicular and the player can't see the object.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
What is the and optimal method, if not the best, for doing it?
Assume that I have an object that has 2 wheels. The only information I have available is how far the wheels have rolled at any time.
Basically, I want to know how to calculate the coordinates (x2,y2)
I put this question on the programming section because I want to solve this with an algorithm or plainly put, by programming (in c++).
Given that you have how far the wheels have rolled at any time, it means that you have two functions of time w1(t) w2(t) giving the distance covered by the wheels.
from that you may by derivation get the scalar velocity of each wheel as v1(t) and v2(t).
As your object position is the mean between the position of those two wheels, the velocity of your object is the mean of those two velocities, but the difference of the velocities gives the speed of rotation of the object. So you have essentially a velocity described as a scalar velocity plus a rotation speed.
By integrating that vectorial quantity you may arrive to the current position of your object.
Details must be thought carefully, but the idea I think is that.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm searching for solution of my problem.
I have some geographical coordinates like this:
Lat. 32.5327 Lon. 95.5019 time 15:44:44
Lat. 32.5339 Lon. 96.1439 time 15:48:31
It's position of some object and time when it was in that position.
What i need is to check in some interval of time(30 seconds for example), what was the position of the object between these points.
Interpolating over a sphere and finding the shortest path between two points would require for example Slerp.
But for distances less than 100km you will end up with a line (more or less) so do not bother and do a linear interpolation.
As #chux pointed out: linear interpolation will exibit significant artifacts when interpolating near the poles.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I try to solve a task for my studies. We got a little framework in which we are asked to put our solution to. There is a line that I don't understand:
Mat3f R (conf.R);
Part of the task is to multiply matrices. So I guess Mat3f stands for a float matrix. But what stands the number 3 for? And what is the conf.R argument for? What will be the dimensions of the resulting matrix?
Thanks in advance!
The exact meaning of the 3 in Mat3f is library-specific, but a normal games programmer seeing it for the first time would expect Mat3f to be a 3x3 matrix.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm developing an application in java that uses openGL (JOGL) to draw a pyramid. When I try to make a translation on the pyramid in direction X, what I see, is that my pyramid was translated in direction Z also. Same thing happens when I try to translate the pyramid in direction Y. Translation in direction Z seems to work without problems. What causes this behavior?
This behaviour can be caused by many different factors.
You might have:
Set up your camera wrong (very likely)
Made matrix transformations, which you didn't reset using glLoadIdentity or glPushMatrix / glPopMatrix.