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.

Newcomers DBPro Corner / Is the car going backwards or forwards?

Author
Message
Oliver
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Switzerland
Posted: 5th Aug 2003 10:58
How can you find the speed of a moving object and have it positive when going forward and negative for backwards.

Not sure if this is a really simple question or not , but its got me thinking for a long time,

Thanks
ReD_eYe
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 5th Aug 2003 11:08
you use variables!
for instance
speed=5
move object car,speed
you can then set speed to a minus value to make the car reverse, or increase it to speed it up

I have a website!!!
So go there: http://www.freewebs.com/darkb/index.htm
on second thought you probably shouldn't
Oliver
23
Years of Service
User Offline
Joined: 24th Nov 2002
Location: Switzerland
Posted: 5th Aug 2003 11:54
Well that would be nice, but the problem is a little bit more complicated. I am trying to find the speed of a car, though there is a lot of physics involved. It has momentum, and uses the newxvalue and newzvalue commands.

So I could find the absolute speed by adding the two vectors . However I am using the speed for turning the wheels of the car. So even if you go backwards the wheels still turn forwards. For example:

(xspd#^2+zspd#^2)

Thanks
Scorpyo
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 6th Aug 2003 00:10
in pseudo code:

if result<0 then wheelrotation=wheelrotation * -1

hope it explains the concept..
cheers

Login to post a reply

Server time is: 2026-07-07 13:15:46
Your offset time is: 2026-07-07 13:15:46