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.

Author
Message
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 4th Jun 2004 16:55
i dont fully understand how the wrapvalue command can be used to rotate an object. here is my code


now when i press the right or left key it moves a little bit but then stops. can someone tell me wot im doing wrong!
thanks

If nobodys perfect then im nobody!
Dom
20
Years of Service
User Offline
Joined: 31st May 2004
Location:
Posted: 4th Jun 2004 16:58
oh theres a spelling mistake at the rightkey() command so thats not the problem

If nobodys perfect then im nobody!
tom p
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location:
Posted: 4th Jun 2004 18:45 Edited at: 4th Jun 2004 19:12
Your y# doesn't change, try this:




Or this, which is tidier but harder to read:



cheers, Tom
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 4th Jun 2004 19:06
You need to get the yangle and store it in yr# in the do loop



Otherwise yr# will always be 0 and the reason it rotates a bit is because he reads this:



Quote: "
UPDATED

Amd 2800+ 1024mb pc3200 A7N8X - Deluxe Ati Radeon 9800PRO 256mb
"
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 4th Jun 2004 19:58
Wrapvalue simplay takes a number and converts it to an angle within 0-360 degrees.

Example:

wrapvalue(50) will return 50
wrapvalue(-10) will return 350 (360-10)
wrapvalue(400) will return 40 (400 is 40 degrees too high, round it off)

Two strings walk into a bar. I'll have a pint says the first$%ASLDJ09920D"$"$D. Excuse my friend says the second, he isn't null terminated.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Jun 2004 21:03
Here's how the wrapvalue command works.


Where "%" represents the modulus symbol. (i dont think DB has that)

"eureka" - Archimedes
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 5th Jun 2004 01:08
ye can make a mod function easily:

function mod(nr#,nrr#)
endfunction nr#-(int(nr#/nrr#)*nrr#)

Quote: "
UPDATED

Amd 2800+ 1024mb pc3200 A7N8X - Deluxe Ati Radeon 9800PRO 256mb
"
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Jun 2004 12:24
My code is messed up. i can't even remember if modulus returns the remaind of a division, or the number of times number2 goes into number1. But the following code works as a wrapvalue command.




"eureka" - Archimedes

Login to post a reply

Server time is: 2024-11-26 19:56:29
Your offset time is: 2024-11-26 19:56:29