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 Professional Discussion / Super Simple EZrotate code... y u no work?!

Author
Message
PiaPoi
13
Years of Service
User Offline
Joined: 4th Dec 2012
Location:
Posted: 29th Apr 2013 01:43
Hello! Very much a noob, so apologies for the ignorance but...

One thing I found annoying with EZrotate is that EZRO_GY 10 tells it to rotate BY 10 degrees, rather than TO 10 degrees, as yRotate Object x, 10 does. I also noticed that EZRO_ObjGY seems to work in the latter way, but I can't get it to work! I made a super simple trial, but no luck. Can you please help me understand what I'm doing wrong?

Here's my code:


If I replace the EZRO stuff with yRotate Object 1, 45, it rotates.

Ultimately, I'm trying to get my car to move over the terrain, pitching and rolling accordingly. I've got the angle I want the car to be at, and it kind of works with EZRO_GetEuler etc. but it gets out of sync quite quickly because of having to calculate the difference each time, rather than just the angle.

Would so much appreciate any help! Thank you!
luskos
19
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 30th Apr 2013 17:03
This works :



Coding is My Kung Fu!
And My Kung Fu is better than Yours!
PiaPoi
13
Years of Service
User Offline
Joined: 4th Dec 2012
Location:
Posted: 30th Apr 2013 18:35
Aha, so it does!! Thank you! Leaves me with a problem, though...

If you're in a loop...

...is there no way of just telling it to rotate to x degrees as you would with yRotate Object?

If not, how do you get it to tilt to the angle you want? I currently save the position from the previous loop and then tell it to rotate by the difference, but it seems to get out of sync very quickly, like it's not totally accurate. :/ I can't believe it's too difficult to get a car driving about over a terrain, I just can't quite... get there!

Thank you again for your help very much appreciated.

Login to post a reply

Server time is: 2026-07-07 00:29:56
Your offset time is: 2026-07-07 00:29:56