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 / Need help on object rotation, etc.

Author
Message
Sleet
21
Years of Service
User Offline
Joined: 3rd Aug 2003
Location:
Posted: 16th Dec 2003 08:43
There is a game example that comes with darkbasic, it's called tank or something. I plan on creating a game very similar to it and using parts of it as a template so that when I need to learn how to do something I am not totaly lost. But there is one very important part of the code that I cannoth figure out, that would be the part of the code that rotates the tank so that it seems the tank tracks are following the terrain.

What I am looking for is someone to explain to me the fundimentals of how it works. I am completely lost because there are some variables used that I can't figure out what they have to do with anything, and when I find out what is used to give the variables a value I find that the code uses other variables that seem tohave even less to do with the rotating andf tilting code than ever! One example would be a variable used in part to create another variable which is used in the section of rotating code, and that first variable is nothing more then half the x or z value of the matrix size! WTF? I am so lost but I'm dead in the water basicaly without a grasp of this code.
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 16th Dec 2003 10:11
without actually looking at it again(short of time) i'd guess that what it does is find the height of the ground at each corner of the tank, and then uses trigonometry to work out the angle required. thats not explained very well, but it might give you a hint


GO TO THE ETERNAL DESTINY FORUMS!!! http://forums.eternaldestinyonline.com
Do it now!!!
Sleet
21
Years of Service
User Offline
Joined: 3rd Aug 2003
Location:
Posted: 17th Dec 2003 05:59
Things I'm looking for are like why you need to use variables like landsize# (that's one that's used in the code to create a variable used to help find the angles and it is half the value of the x or z length of the matrix that is used for the ground. Go figure.)
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Dec 2003 23:46
Quote: "of the code that rotates the tank so that it seems the tank tracks are following the terrain."

I dont have the code in front of me either, but I can take a guess. It either rotates a limb, or uses a dummy object to control rotation. I know it uses a dummy object for the tilting and rotation on the landscape that way.
Sleet
21
Years of Service
User Offline
Joined: 3rd Aug 2003
Location:
Posted: 18th Dec 2003 07:30
It does use a dummy object, but I can't even figure out why you would need one, can someone get the code in front of them? Every copy of DB (at least classic) has it.
Sleet
21
Years of Service
User Offline
Joined: 3rd Aug 2003
Location:
Posted: 20th Dec 2003 03:15
anyone?
Sleet
21
Years of Service
User Offline
Joined: 3rd Aug 2003
Location:
Posted: 23rd Dec 2003 11:20
bump

it's sad when I have to do this to get an answer I can use
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 23rd Dec 2003 14:49
go here and run my example code
http://darkbasicpro.thegamecreators.com/?m=forum_view&t=21427&b=1
check it out and let me know what you don't understand..
basically it's Lee's tank code re-used
cheers

Login to post a reply

Server time is: 2024-09-21 15:12:01
Your offset time is: 2024-09-21 15:12:01