ray problem

Started by
2 comments, last by IStrikerI 22 years, 8 months ago
i need to rotate a rays vector so that it points to a certain point. i already know how to rotate a vector by a certain amount of degrees. i thought about calculating a vector from the rays origin and the certain point using vector subtraction and then using the dotproduct to get the angle between this vector and the rays vector. then i rotate the rays vector by this angle. but i saw that this only works in 2D. in 3D i have to rotate the vector by two angles around the X and the Y axis. can somebody help me ?
Advertisement
Do you need to calculate euler angles? If you don''t, you can just make a look-at matrix and multiply the ray by it.
Actually it''s very simple:

you have
- a ray=(origin,direction)
- a point P

just fill in normalized(P-origin) for direction

There''s no need for a rotation
yes thx, but i realized that this was not my real problem.
sorry, i already got it :-P

This topic is closed to new replies.

Advertisement