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.

3 Dimensional Chat / easy Rotation Problem

Author
Message
giorgio
21
Years of Service
User Offline
Joined: 7th Feb 2003
Location:
Posted: 7th Feb 2003 11:40
Hello!

does anybody knows why the two following lines :

zrotate object 1,90
xrotate object 1,90

give the same result than :

xrotate object 1,90
zrotate object 1,90

even if you use the set object rotation xyz or zyx...

please, help !

thanks a lot...
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 7th Feb 2003 14:13
what are you using to test this?.. because they shouldn't

Tsu'va Oni Ni Jyuuko Fiori Sei Tau!
One block follows the suit ... the whole suit of blocks is the path ... what have you found?
giorgio
21
Years of Service
User Offline
Joined: 7th Feb 2003
Location:
Posted: 7th Feb 2003 16:28
ok,
please try exactly the following code
as a project in db pro :

set display mode 1024,768,16
make object cylinder 1,3
yrotate object 1,90
xrotate object 1,90
while 1
endwhile

the result is exactly the same than (exchange x and y):
set display mode 1024,768,16
make object cylinder 1,3
xrotate object 1,90
yrotate object 1,90
while 1
endwhile

it should be not ?!

empty
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 8th Feb 2003 02:34
The code works correctly

the rotation applies to the object's absolute positions which remain even after rotating.
Try

make object cylinder 1,3
xrotate object 1,90
fix object pivot 1
yrotate object 1,90
wait key

After you xrotate the object you set the current angle as the new absolute rotation with fix object pivot objno.

Ogres have layers.
giorgio
21
Years of Service
User Offline
Joined: 7th Feb 2003
Location:
Posted: 9th Feb 2003 14:48
it works, you are right, thanks a lot !

in fact my real problem was a little bit more complex

I wanted to turn a car wheel on y and z

I needed your fix object pivot but it was not enough

I just found the solution of my problem. it is exactly:

rotate object i,0,0,0 // re-init rotation
zrotate object i,wheel_angle // first, wheel turn on itself
fix object pivot i
yrotate object i,car_angle+steer_angle // wheel orientation on the road
zrotate object i,0 // this magic line was missing to keep my wheel vertical after the first zrotate...

thanks a lot for your help with fix object pivot which missing !

Login to post a reply

Server time is: 2024-04-19 00:22:05
Your offset time is: 2024-04-19 00:22:05