Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / object rotation axis

Author
Message
arras
22
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Slovakia
Posted: 12th Feb 2003 19:13
Is it possible to rotate object around world axis instead of object axis?

commands ROTATE OBJECT and X-Y-ZROTATE OBJECT rotate object around its own axis.

thanks
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 13th Feb 2003 01:34
you could do it with some code similar to this (I tested it but there was an error in it and I don't have time now to figure it out exactly... It's late here and I'll go to bed now.

With tis function I tried to rotate an object around the world y axis. It didn't succeed I think (I'm not sure). Just think about this... you'll find it I guess (if you know what sin and cos are). It shouldnt be too difficult to give the coordinates of the point around which to rotate.



arras
22
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Slovakia
Posted: 13th Feb 2003 10:43
OK I will look at it, but as far as I understand sin and cos functions this doesnt look to make job. It look like to move object on selected angle and calculate its new position.

I made code which its doing what I want by using FIX PIVOT comand, but its complicated, each time you want to change its angle you have to rerotate object to original 0,0,0 rotation, refix pivot and rotate again on selected angle by fixing pivot for each x,y,z rotation separately.
Of course you have to store old angle values in order to get it back to original position.

I just wanted to know if there is more simple way to do it...?

freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 16th Feb 2003 13:42
just don't fix the pivot point?

arras
22
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Slovakia
Posted: 5th Mar 2003 17:03
I found out that problem is only with x rotation.
I made pivot object and glue my object to it.

When I rotate around y and z axis I rotate my object, around x axis I rotate pivot object.

Pivot object can be simple plain or cube and its hiden.

Login to post a reply

Server time is: 2025-08-08 20:40:05
Your offset time is: 2025-08-08 20:40:05