Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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;

Posted

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

Posted

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"

  • *Experts*
Posted

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

"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
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...