3d rotation's 
Author Message
 3d rotation's

Hello all,

I am trying to work on rotating a 3 dimentional cube in qbasic and have come
across a little problem.  I'm able to rotate it in two dimentions, but am
stuck on the third.  I know Sine and Cosine have a lot to do with the
relationship between x and z, and y and z but am still stuck on the
coverstion from a 3d to a 2d plane.  I have seen various graphics routines
on the net and have looked them over with little luck of EXPLANATION.  If
there is anyone who has a little insight in to this problem of mine, it
would be much appreciated if you could share it with me

Thanks to all,

- Chris Mullens



Wed, 18 Oct 2000 03:00:00 GMT  
 3d rotation's

Hi Chris,

What I used to do (bit of a cludge) was display x = x+y and y = y+z. Then
rotate whichever plane. So if I wanted a rotating cube I would rotate all
planes and show the lines with the above x-y relationships. The scaling is
done by

x = x * cos(a) + y * sin(a)
y = y * cos(a) - x * sin(a)

where a is the angle. This rotates about orign so the cube has to have
centre at origin to work properly. Hope it helped, havn't done this stuff
for ages...

--

---------------------------------------------------------------

     xMSV Not Invented Here
          oGCU Fate Amenable To Change
     I don't understand. Whats going on? How did you get to where you are?



Wed, 18 Oct 2000 03:00:00 GMT  
 3d rotation's

Quote:

> ---------------------------------------------------------------

>      xMSV Not Invented Here
>           oGCU Fate Amenable To Change
>      I don't understand. Whats going on? How did you get to where you are?

oh, yeah hehehe

   xLSV Serious Callers Only
      Eccentric Shoot Them Later
   My dear friend, we do not know what the Excession offered or threatened..
............................................................................
...Genar-Hofoen's uncle Tish sends his regards and has forgiven us.


Wed, 18 Oct 2000 03:00:00 GMT  
 3d rotation's

Hi...
Here are the transformation equations:

in these equations, x,y,z represent the points of the solid you want to rotate

To rotate around the X axis
    newX=x
    newY=ycosA-zsinA
    newZ=ysinA+zcosA

To rotate around the Y axis
    newX=xcosA-zsinA
    newY=y
    newZ=xsinA+zcosA

To rotate around the Z axis
    newX=xcosA-ysinA
    newY=xsinA+ycosA
    newZ=z

assuming the screen axes are X and Y and the depth is Z,
    you plot newX and newY

note that you can combine these equations into one for multiple rotations
(if you need those, let me know)

good luck
George

Quote:

> Hello all,

> I am trying to work on rotating a 3 dimentional cube in qbasic and have come
> across a little problem.  I'm able to rotate it in two dimentions, but am
> stuck on the third.  I know Sine and Cosine have a lot to do with the
> relationship between x and z, and y and z but am still stuck on the
> coverstion from a 3d to a 2d plane.  I have seen various graphics routines
> on the net and have looked them over with little luck of EXPLANATION.  If
> there is anyone who has a little insight in to this problem of mine, it
> would be much appreciated if you could share it with me

> Thanks to all,

> - Chris Mullens



Thu, 19 Oct 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. 3D Camera rotation around any object in 3D space

2. 3D Rotation Points

3. 3D rotation

4. 3D rotations...

5. 3D Rotation on z-axis...problem....

6. Problem with 3d camera view rotation...

7. 3D rotations and graphs

8. Newbie's question - rotation of an image

9. Graphical Buttons - can't get rid of 3D appearance - help

10. Masked Edit Doesn't Display 3D Border in NT

11. Help me mangle Sheridan's 3D button widget

12. VBX for AutoDesk's 3D Studio

 

 
Powered by phpBB® Forum Software