AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Opengl animation example car2/14/2023 ![]() GiroZl = giroZl + (1.0 if giroZl < 50.0 else 0.0)Ĭan you guys give me some suggestions of how to make the car steering? Thank you. GiroXl = giroXl + (1.0 if giroXl < 50.0 else 0.0) Traslacion = traslacion + (1.0 if traslacion < 100.0 else 0.0) # The glutTimerFunc, where the values get manipulatedĪngulo = angulo + (1.0 if angulo < 180.0 else 0.0) # This is where I try to turn the car along the track curve, this is where I'm stuck GlTranslate(0, 0, traslacion) # Moves the car along a straight line, this works just fine # The display function, where the 3D car model recieves the intructions for My code looks like this: # Values for all the animation process, including translate and rotate The way that I've tried is making the car tranlate over the x and z axis, as well as making a glRotate to rotate the car, but that doesn't seem like the best way to do it. The problem is that I don't seem to find the best way to make the car turn along the curve of the track. I'm trying to animate a 3D car in PyOpenGL to make it move along an eight-shaped track. ![]()
0 Comments
Read More
Leave a Reply. |