SDittmar Posted February 11, 2003 Posted February 11, 2003 I want to understand 3d graphics and directx. ive read so many tutorials but I always get stuck when i get to the geometry part. Say a rotating cube, I always see something like pi / 180. I dont understand this concept. Please someone explain to me what makes the cube rotates (using directx7/8/9 or gdi+) thanx Quote
hawk3d Posted February 11, 2003 Posted February 11, 2003 That's why all the operations with sin,cos,tan etc... requires radians and not degrees. 360º=2*PI so if you want to know an alpha degree in radians you have to do radians=(alpha*2*pi)/360 --> (alpha*pi)/180; Quote
SDittmar Posted February 11, 2003 Author Posted February 11, 2003 ok, so the pi/180 is merely conversion from degrees to radians. What about Sine and Cosine, are these what increment the rotating cube? And what is an alpha degree? thanx for replying Quote
hawk3d Posted February 11, 2003 Posted February 11, 2003 ok alpha is only the name of the variable that contains the angle value in degrees, it just a name. Sin and Cos functions are used when you try to rotate an object without using the rotate methods provided by directx or opengl libraries. Here are the formulas to rotate any 3d point by the brute force method. x'=z*sin(yaw)+x*cos(yaw) y'=y z'=z*cos(yaw)-x*sin(yaw) x"=x' y"=y'*cos(pitch)-z'*sin(pitch) z"=y'*sin(pitch)+z'*cos(pitch) x"'=y"*sin(roll)+x"*cos(roll) y"'=y"*cos(roll)-x"*sin(roll) z"'=z" Quote
SDittmar Posted February 11, 2003 Author Posted February 11, 2003 could you explain these formulas a little further? what are the apostrophes for? And yaw, pitch, and roll? thanx Quote
*Gurus* divil Posted February 11, 2003 *Gurus* Posted February 11, 2003 There are whole books devoted to mathematics in 3D space, some specifically target towards game programming. It would probably be well worth to money to purchase one. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
SDittmar Posted February 11, 2003 Author Posted February 11, 2003 do you have a recommendation? i dont know much geometry, so i'd like something that will teach geometry specific to computer graphics. thanx Quote
*Gurus* divil Posted February 11, 2003 *Gurus* Posted February 11, 2003 Sorry, I don't, I've never actually read any of them. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
*Experts* Nerseus Posted February 11, 2003 *Experts* Posted February 11, 2003 What level of school are you, SDittmar? In the US they cover Trig somewhere between 8th and 10th grade, usually (if I remember right). If you haven't gotten that far yet, you may have a tough time picking it up - but feel to go to your librarian and ask for a book. Many graphics, unfortunately, either don't cover the basics very well or go into pure-formula mode. I'd stick with a math book for now, to pick up the basics of Cos, Sin, Tan, etc. -nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Azrael Posted February 28, 2003 Posted February 28, 2003 Just about the defacto base knowledge book on computer graphics is : "Computer Graphics: Principles and Practice in C" by Foley, Van Dam et al... Here are link to it at Amazon Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.