|
Author |
Topic: simple translate problem (Read 256 times) |
|
wilson
|
simple translate problem
« on: Apr 9th, 2004, 8:59am » |
|
hi. having trouble w/ what I hear is a pretty basic translate issue: Basically, I have a center point (width/2, height/2) that I want everything, let's say a bunch of randomly placed circles, on the screen to rotate around. This is easy enough to do: just set: translate (width/2, height/2); rotate(angle); //draw circles out i++; angle = radians(i); However my issue stems from needing to adjust not only the rotation off all these objects, but also adjusting the y position linearly. So, perhaps a description of the application would be appropriate here: the center of the screen represents a person always looking forward, straight up the y axis. the circles around represent objects of interest in the environment. The person is always facing forward, so in order to change the perspective on the circles around him/her, they rotate, then moveforward or backward, etc. So when the person moves forward, the y position of the circles moves towards the center. Then, if the person rotates, they will still be facing forward, but all the circles have rotated appropriately. Think of it as standing still, and turning about in a circle. So, my problem is that I can do either the movement along the y axis, or the rotation part fine on their own. But when I try to combine them, things get screwy -- namely that the x position of the circles always gets snapped back to it's original position. Any ideas?
|
|
|
|
|