glPushMatrix();
glTranslatef(entities[index].x,getheight(entities[index].x,entities[index].z),entities[index].z);
glRotatef(entities[index].rotation,0,1,0);
glBegin(GL_LINES);
glColor3f(0,1,0);
glVertex3f(0,5,0);
glVertex3f(0,-5,0);
glVertex3f(0,2,1);
glVertex3f(0,2,-1);
glEnd();
glPopMatrix();
Rotation Weirdness
These lines blink on and off apparently dependant upon the rotation
Is there any thing I could be doing (in this code) to cause the lines to disapear? Weather or not it has anything to do with rotation :b
Within the code you posted, the only possible way to lose your lines, is if you moved them off with translate, or you rotated them off with glrotate,
if (Both == false)Problem_Is_Else_where();
How would it be possible to rotate it off screen? The way I have it set currently it seems to disapear when the rotation value hits 90 or 270, but if set the rotation manually to 90/270 it doesn't disapear. I question the rotation being at fault because it should (and does allmost all the time) rotate around the center of its mass...
The rotation has no effect on the first line (0, -5, 0) -> (0, 5, 0), because it is parallel to the Y axis (the axis of rotation).
The second line (0, 2, 1) -> (0, 2, -1) it does rotate, and its midpoint spans a circle of radius 2 parallel to the XZ plane when the Y rotation is applied.
Try removing the translation to verify if this is what really happens. The error may be in some other places in your code, in the last places you may expect it to be :o.
The second line (0, 2, 1) -> (0, 2, -1) it does rotate, and its midpoint spans a circle of radius 2 parallel to the XZ plane when the Y rotation is applied.
Try removing the translation to verify if this is what really happens. The error may be in some other places in your code, in the last places you may expect it to be :o.
when I do this
sprintf(errorstr,"%f",entities[index].rotation);
and the result printed is
-1.#IND00
what does that meen :(
sprintf(errorstr,"%f",entities[index].rotation);
and the result printed is
-1.#IND00
what does that meen :(
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement