View Full Version : java: rotation problem

10 October 2005, 07:56 PM
hi all :) i was doing this program to test a few equations i deducted of projection, rotation etc.. but the rotation came with some strange effects. if i rotate, lets say, a point around a pivot, it tends towards the pivot. if its a line, it gets smaller. if its a cube it gets deformed. very weid... looks like i'm loosing information somewhere.
I'll come back here to post the equations

10 October 2005, 08:08 PM
oooki donki:
x = (x-xo) cos(a) - (y-yo) sin(a) + xo
y = (y-yo) cos(a) + (x-xo) sin(a) + yo
for two dimensions, where (xo,yo) is the pivot of the rotation (a point on this case) and 'a' the angle of rotation.
i even tried using some of those other types of variables, with more information and stuff. tried also using a pre-calculated angle, so the cos and sin functions arent the problem..
any clues? :shrug:

10 October 2005, 09:50 AM
Are you using floating point variables instead of integers? You should...

CGTalk Moderation
10 October 2005, 09:50 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.