hi!
let's say i have a vector pointing into a direction. i want to rotate the vector arount some yaw/pitch to make it point into another direction.
how can i do this without having to implement a matrix system into my project?
thanks in advance :)
Printable View
hi!
let's say i have a vector pointing into a direction. i want to rotate the vector arount some yaw/pitch to make it point into another direction.
how can i do this without having to implement a matrix system into my project?
thanks in advance :)
no. since in my raytracer (c#) the only place for the use of matrices would be this:
i send a ray for each pixel on the screen. but the camera can be rotated, so i need this ray of the pixel to rotate with the camera, know what i mean?
Axis-angle rotation would work for this. Just because your system does not currently use matrices does not mean you will not need them for basic 3D operations.
well, do you have an algorithm (code) for that? something with sines and cosines should do the trick but i just don't get it...
Google is your friend: rotate vector around vector - Google Search
call me stupid but i either find 2D stuff, some complex mathematic constructs or porn, but not what i'm looking for.
i just neet this damn formula ;(
If you don't like math then don't attempt 3D graphics or raytracers. If you can read the formulas then stop complaining and figure it out.Quote:
some complex mathematic constructs
don't attempt raytracers?
this is a pic of my raytracer yet: http://www.dev-ch.de/upload/files/De.../Screen329.png
regarding this picture, i'm not stupid, heh :P
ALRIGHT, i bothered my brother until he gave me this:
that's what i really needed.Code:nx * cos(yaw) + (ny * sin(pitch) + nz * cos(pitch)) * sin(yaw)
ny * cos(pitch) - nz * sin(pitch)
-nx * sin(yaw) + (ny * sin(pitch) + nz * cos(pitch)) * cos(yaw)