- #1
DaveC426913
Gold Member
- 22,986
- 6,661
My buddy, a Flash developer, wants to learn 3D rotation of objects from first principles, i.e. using trig. I know there are shrink-wrapped engines out there that will do this for you, but he wants to learn it. From me. Cuz I'm the math whiz.
I used to do this simply when I'd plot simple 3D graphs in "Basic classic" but now I'm stepping it up a notch.
I'll start off with a primitive object and rotation on one axis.
So... my primitive object is a line in the XYZ space. It extends from 0,0,0 to 0,0,100. From my observer PoV, where I can only see the XY plane, the line is seen end-on and will appear as a point.
Now I rotate my line about the origin by 5 degrees. I know that I've got to do sin(5), which is about .087(x100 = 8.7). So the line is now visible in my XY viewing plane connecting 0 , 0 and 8.7 , 0.
Good so far?
Ultimately, it seems to me, I'm going to end up with two equations, x=... and y=... where the right side will be a long string of trig functions with x,y and z angles and x,y and z distances as variables.
Are there more robust techniques I can use? My buddy talks about multiplying matrices, which I know nothing about (but who knows, maybe I'm a quick learn).
And then I've got to add perspective...
I used to do this simply when I'd plot simple 3D graphs in "Basic classic" but now I'm stepping it up a notch.
I'll start off with a primitive object and rotation on one axis.
So... my primitive object is a line in the XYZ space. It extends from 0,0,0 to 0,0,100. From my observer PoV, where I can only see the XY plane, the line is seen end-on and will appear as a point.
Now I rotate my line about the origin by 5 degrees. I know that I've got to do sin(5), which is about .087(x100 = 8.7). So the line is now visible in my XY viewing plane connecting 0 , 0 and 8.7 , 0.
Good so far?
Ultimately, it seems to me, I'm going to end up with two equations, x=... and y=... where the right side will be a long string of trig functions with x,y and z angles and x,y and z distances as variables.
Are there more robust techniques I can use? My buddy talks about multiplying matrices, which I know nothing about (but who knows, maybe I'm a quick learn).
And then I've got to add perspective...
Last edited: