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 / rotating object in dark basic pro

Author
Message
xavier jefferson
15
Years of Service
User Offline
Joined: 11th Apr 2011
Location:
Posted: 11th Apr 2011 18:27
mi trying to create a game in dark basic pro and ive comes across this problem.

i was trying to load in my .x file air ship and tryed using the position object
point object
and rotatie object commands but it never tuens the ship so that what you see is the back of the ship instead of the side of the ship.

heres the command im using

Rem Player Character
load object "S:\comptech\ComputerScience\2ndPeriod\Xavier_Kyle\102813_Xavier\carbonade project\carbonade code\images\ship.x",1
scale object 1,50,70,50
texture object 1,87
position object 1,0,500,0
make object collision box 1,-25,-35,-25,25,35,25,0
rotate object 1,500,90,90
point object 1,90,900,25


with this current code all i see is the side of the ship
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 11th Apr 2011 18:53
When you rotate an object then point it, your actually cancelling out your rotation and relying on it's default orientation.

Once you rotate it, use FIX OBJECT PIVOT 1 - this will lock the objects rotation, then pointing or rotating should be more sensible. You might want to do some experiments to get the rotation stuff right, it's vital knowledge for DBPro.

Health, Ammo, and bacon and eggs!
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 11th Apr 2011 19:12
Quote: "rotate object 1,500,90,90"


500? It should be a number between 0-360...

TheComet

xavier jefferson
15
Years of Service
User Offline
Joined: 11th Apr 2011
Location:
Posted: 13th Apr 2011 18:00
thanks you guys info worked i ended up doing some testing and ended up doing it this way

Rem Player Character
load object "S:\comptech\ComputerScience\2ndPeriod\Xavier_Kyle\102813_Xavier\carbonade project\carbonade code\images\ship.x",1
scale object 1,50,70,50
texture object 1,87
position object 1,500,500,0
make object collision box 1,-25,-35,-25,25,35,25,0
rotate object 1,-90,-95,0
FIX OBJECT PIVOT 1

Login to post a reply

Server time is: 2026-07-17 13:59:23
Your offset time is: 2026-07-17 13:59:23