showing step by step

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.

If you want to display text in the opengl viewport, you can use glut. See here:

lighthouse3D glut tutorial

Another lib for character rendering:
QuesoGLC

no no

i want to draw point to each coordinate:/

hu? Can you develop a bit more, your problem?

i want to draw graphic of a vehicle’s journey. i have to add new position of the vehicle step by step.i should’t draw all the graph at a moment.

Set 2D projection and draw line stripes with GL_LINE_STRIP.

Use a timer and redraw the graph adding new points.

Turn off all buffer swaps so every car draw draws over the last?

A very good example of a bad idea. First, if you don’t swap on a double buffered window, you just won’t see anything. Second, if you use single buffered window… well, don’t ever use single buffered windows :wink:

i wouldnt draw a new a new point for the line each 1 second or so

ild only add new points if the car has moved enuf distance, this way youre not adding extra points if the cars stationary + also it handles the path correctly if the cars going quick.

if ( LENGTHOFVECTOR( car_pos - prev_car_point_pos ) > 1.0 )
{
add_point( car_pos );
}

you can do that either in screen or world space

zed, but if the car goes very fast, you’ll add many redundant points!

I would check the curvature of the trail and add points only, if the angle between the last two segments exceeds a limit.

Funny thread. :slight_smile:

CatDog

A very good example of a bad idea. First, if you don’t swap on a double buffered window, you just won’t see anything. Second, if you use single buffered window… well, don’t ever use single buffered windows :wink: [/QUOTE]

Not a bad idea, just badly worded. :slight_smile: Well ok maybe both. Youre right, it isn’t the swap, it’s the neglecting to glClear where you see a bunch of acid-trip tracers. A record of motion as requested.
And no, I’ve never used acid.

yes youre rights thats even better