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 Discussion / how can i immitate this track effect?

Author
Message
Tim Ballisto
21
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Right behind you.
Posted: 9th Apr 2004 23:44 Edited at: 9th Apr 2004 23:56
in one of my favorite games, f-zero gx, the racers are glued onto tracks that...
twist
http://www.lawrence.com/art/apps/pennynews/1062017626_fzero22.jpg

are on the INSIDE of a pipe
http://www.game-revolution.com/previews/screens/gamecube/f_zero_gx/f_zero_gx5b.jpg

are on the OUTSIDE of a pipe,
http://images.google.com/images?q=tbnnPzTHRDJGcJ:www.smashboards.com/fzero/Screens/firefield_l.jpg

but can still jump
http://images.google.com/images?q=tbn:KJKNKMnaDC8J:www.smashboards.com/fzero/Screens/bigblue_l.jpg


some may say i should show some effort, but frankly, i have no idea.

EDIT and i'm not asking for "teh codez", i just want some inspiration or a concept.


Programs for programmers.
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 10th Apr 2004 00:53
Quite possibly waypoints with additional data attached to them, such as the angle you need to hit it at.

The collision also needs to be more complex, 'cos the gravity element goes right out of the window.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
guru of boredom
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: middle of no where
Posted: 10th Apr 2004 09:02
it might have something to do with the object normals. like gravity is the reversed normal or something. not really sure as i have been trying to do this aswell but i have only gotten it to work until about 60 degrees of tilt. let me know if u want to work on it with me

we are not outnumbered! we are just in a target rich enviroment!
P4 2.4 ghz 120 GB 256 mb GeForce4
guru of boredom
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: middle of no where
Posted: 10th Apr 2004 09:09
on second thought does dbp even use object normals?

if not then u might just need to have a waypoint system like batvink said but have a second way point to use in making the gravity vector. for instace u could have the second "gravity" waypoint be in the center of the spiral

we are not outnumbered! we are just in a target rich enviroment!
P4 2.4 ghz 120 GB 256 mb GeForce4
pizzaman
21
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Gateshead, UK
Posted: 11th Apr 2004 18:19
If you want the concept here it is

For travelling on the outside of the tube the centre of gravity is always at the centre of the tube, therefore you must work out the 3d distance from your racer to the centre of gravity. Then if the 3d distance is greater than the tracks distance to the centre of gravity decrease the racers 3d distance to the centre of gravity, however make sure if the racer is touching the track that you do not decrease the racers 3d distance or set the racer at the tracks 3d distance from the centre of the tube (make sure you put the command after gravity code). This will have the effect of gravity on your racer on a tube. Now jumping is made easy because all you have to do is increase the racers 3d distance from the centre of tube- but make sure the increase is greater than the decrease in 3d distance caused by the gravity effect or the racer wont jump.

For a racer in a tube its the opposite effect, therefore gravity seems to be pulling the racers away from the centre of the tube. To get this effect do the same as before, work out the 3d distance from the centre of the tube to the racer and the 3d distance from the centre of the tube to the track. If the racers distance is less than the tracks distance from the centre of the tube increase the racers distance, however make sure if the racer is touching the track that you do not increase the racers 3d distance or set the racer at the tracks 3d distance from the centre of the tube (make sure you put the command after gravity code again). This will produce the gravity effect, also for jumping just decrease the racers distance from the centre of the tube.

Dist = sqrt((object position x(x)-cotx#)^2 + (object position y(x)-coty#)^2 + (object position z(x)-cotz#)^2)

That's the formula for calculating distance in a 3d world, where cotx#, coty#, and cotz# are the positions of the centre of the tube.

The hardest thing to do is find the centre of the tubes x, y, z, co-ordinates at any point on the track, for this I cannot help you, however I have an idea if you know the tubes radius at any point and the racer is on the track then the distance from the racer to the centre of the tube is the radius, also take into account the orientation of the racer within its own 3 axes hence the x, y, z planes

Sorry for the long winded nature of this post but its hard to explain the concept but easy to think about.

Anyways hope this helps you

Login to post a reply

Server time is: 2025-05-23 06:07:45
Your offset time is: 2025-05-23 06:07:45