Sign in to follow this  
ceylan

showing step by step

Recommended Posts

there is a vehicle that is moving.how can i show its coordinates step by step in opengl? either old coordinates or new coordinate should be drawn.after every 1 second,another new coordinate should be drawn.

Share this post


Link to post
Share on other sites
I suppose you're in 3D, but the logic is the same.
Assuming you're able to draw some type of "marker" (aka a sphere, a cube, whatever), use a small timer that samples the position of the vehicle every second or so, saves it in a list an then draw a marker on each position.

something like that (pseudo-code ahead)

std::vector<vec3> posList;

static float time = 0;

float currTime = getCurrentTime();

if(currTime - time > 1)
{
time = currTime;
posList.push_back(vehicle.GetPosition());
}


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this