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 / RTS Object Tracks

Author
Message
A r e n a s
18
Years of Service
User Offline
Joined: 9th Jun 2008
Location:
Posted: 17th Jun 2011 09:39
Hi everyone,

Its me again. I was wondering whether anyone knows how to do this;

'Move an object and have tracks behind the moving object and then have these tracks fade out after 3 seconds.'

I can think of ways to do this, but I cant help but wonder if anyone has efficient ways of doing this! Any help from people would be brilliant, as I've managed to get all things working fine with object movement. Once I know how to do these tracks, then I can add a bit more complexity and work out way-points for movement ect... Im just looking to complete basic movement first.

A

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 17th Jun 2011 09:48
I don't think there's an easy way to do this, Fallout had a really nice track effect on his RTS project, maybe he'll spot this and offer some advice.

The last time I did this was on DBClassic, with a snowboard leaving a track - I used the MAKE OBJECT TRIANGLE command, and just re-made the tracks in a loop, so the furthest away track is used next. Was not too bad because the camera was behind the snowboarder, no fading or anything fancy like that. I would suggest stitching track objects together, like add 4 dummy cubes, one at each side of your tracks, then that gives the 3D locations to make tracks from. So if you imagine your tracks are made of rubber, one end of each track is attached to these limbs, and the other end is stuck in the ground. When the tank turns by and moves, you stick the limb end of the track onto the ground, then start a new track object to continue from it - using the limb positions as the end, and start of your track objects.

You would need to know how to vertex modify a plain for that, but I think it should be fast enough. While your doing that though, you can adjust the UV coordinates so the track texture is exact, even fade out the start of the track, set it's alpha to nothing - then the track will look like it fades into the ground, like the tank is digging in.

That's what I would do, and its my best guess as to what Fallout did with his.

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: 17th Jun 2011 11:26
If you're any good with vertexdata commands and memblocks, you could make a mesh where 10 plain objects are connected to each other. Then you could reposition the first 2 vertices of the object on to the position of the tank's track, and reposition all other vertices to the last positions of the vertices before them (did that make sense? )

For the fading, just edit the color diffuse of the vertices via memblocks so the ones in front are fully there, and the last ones are fully faded.

TheComet

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 17th Jun 2011 12:22
Hi there. Time ago I made a 20 lines code that can do somthing like that. The code as we all know in just 20 lines looks a mess, but you can descompress it and use it as you like.

http://forum.thegamecreators.com/?m=forum_view&t=163098&b=11


Image made by jeffhuys with my program.



Cheers.

I'm not a grumpy grandpa

Login to post a reply

Server time is: 2026-07-10 21:18:37
Your offset time is: 2026-07-10 21:18:37