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 / Rotating object

Author
Message
Renegade
21
Years of Service
User Offline
Joined: 29th Jul 2003
Location: Israel
Posted: 23rd Jan 2004 23:53
I need some help to rotate an object
I did a matrix and insert a tank in it
I want to tank to stand in one spot but I need it to
rotate to left and right (according do to buttons of course)
the problem is that I have no idea how to do it

The only thing I can guess is that the code will come where
I put `===========.

BTW this is my first game

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 24th Jan 2004 00:14
yrotate object 1,object angle y(1)-1

yrotate object 1,object angle y(1)+1

just a simple way of doing it.
use values less than 1 for slower pivot

-RUST-
Renegade
21
Years of Service
User Offline
Joined: 29th Jul 2003
Location: Israel
Posted: 24th Jan 2004 00:40 Edited at: 24th Jan 2004 00:41
Worked but not very good
I can turn the object left but when I tried to turn it right
I get an error "Runtime error at line 45, Specified angel must be 0 to 360 degrees at line 45"
how can I solve it?
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 24th Jan 2004 00:44
For both, use:

wrapvalue(object angle y(1)-1)
wrapvalue(object angle y(1)+1)

that way, it will stay between 0 and 360 degrees


Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
Renegade
21
Years of Service
User Offline
Joined: 29th Jul 2003
Location: Israel
Posted: 24th Jan 2004 00:49
I got also an error but this time its a Syntax error
I guess it becuase I got DBC :\
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 24th Jan 2004 01:10
I hope you coded this:

yrotate object 1,wrapvalue(object angle y(1)-1)
yrotate object 1,wrapvalue(object angle y(1)+1)




Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 24th Jan 2004 01:19
not that it makes any difference in this example (if I remember correctly) but for future reference please specify if you are using DBC, as these boards are dbp related - and if not specified I assume dbp. Either way the inclusion of the wrapvalue function should solve the problem (Unless of course the angle value exceeds 36000 +/-) then "kablooooie" (plays explosion.wav) the wrapvalue function blows up.

-RUST-
Renegade
21
Years of Service
User Offline
Joined: 29th Jul 2003
Location: Israel
Posted: 24th Jan 2004 01:21 Edited at: 24th Jan 2004 01:26
Now its working

Quote: "please specify if you are using DBC, as these boards are dbp related "


I know I just forgot srory about that
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 24th Jan 2004 01:38


-RUST-
"What the... Mooooooooooo!"
Renegade
21
Years of Service
User Offline
Joined: 29th Jul 2003
Location: Israel
Posted: 24th Jan 2004 11:27
Thank you all for your help

Login to post a reply

Server time is: 2024-09-21 17:53:57
Your offset time is: 2024-09-21 17:53:57