PDA

View Full Version : HOW TO HAVE A ROTATING CIRCLE WITH TWO COLR CHANGES HAPPENING.



prashantgp
10-28-2002, 01:19 AM
hay,
i need to draw a circle. the circle has a measure of indication of pitch and roll angle of the aircrafts.
according to the quanties meaured, either pitch or role , the circle should be able to change the proportion of colors accordingly.
blue indiating towards sky and brown towards
earth.
i am able to draw some lines , representing various degrees of pitch and roll.
but how to make them move(translate) i dont know.
pls help.

vladk
10-30-2002, 04:51 AM
What exactly are you trying to make?

A HUD?

marcus256
10-30-2002, 02:41 PM
One way to solve this is to have a texture that is split into two halves, one for each color. Then draw a filled circle (e.g. GL_TRIANGLE_FAN), with the texture coordinates for each vertex mapping so that the texture will be drawn as if pitch & roll is "zero" (standing on the ground). Finally, rotate & and translate the texture with the GL_TEXTURE_MATRIX so that it corresponds to pitch and roll (pitch = translate, roll = rotate).

Aah, a bit too complicated to explain in a simple post, so this may sound strange.