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 / Space ship vector trails

Author
Message
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 26th Nov 2003 21:17
At the moment I am trying to solve the problem of placing a vector trail behind a spaceship / missile. Similar to the effect seen in Homeworld.

I have seen this done in DB before by Pincho Paxton, so I know it's technically possible, the problem now is whether my little gray matter can figure it out.

At the moment I am struggling. I have written a routine that is for the moment called once a second and stores the last 5 positions of the object I want to have a trail, the problem is that the routine seems quite slow to execute, and it is not displaying a trail.

At the moment this is just a testcode so I have repositioned the Y vertices to make a larger triangle to ensure it is visible, no luck though :/ Here is where I am at:



Am I even barking up the right tree on how to do this? I thought this would be a fast method, but then again, I thought Brahma was for obese gentlemen with a fetish.


God created the world in 7 days, but we're still waiting for the patch.
feiting
22
Years of Service
User Offline
Joined: 19th Oct 2003
Location:
Posted: 26th Nov 2003 21:58 Edited at: 26th Nov 2003 21:58
maybe do a

position object trail, missilex, missiley, missilez
set object to object orientation trail, missile
move object trail, -10

simple way, then sync it after.

He who does not take the assassin job, will get killed by one who does.
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 26th Nov 2003 22:03
Doing that would create only 1 segment of the trail, I would like it to twist and turn with the source object and fade out over time, otherwise I would just make it part of the main model and hide the limb when not in use.


God created the world in 7 days, but we're still waiting for the patch.
waffle
23
Years of Service
User Offline
Joined: 9th Sep 2002
Location: Western USA
Posted: 26th Nov 2003 22:17
the idea is still sound. Use say 100 triangles (takes up less space than a plain) and take the oldest triangle and place it at the current end of the missile/plane/ship or whatever....

In theory, its rather simple. In practice, you must always track the facing of all "smoke" triangles to ensure they face the camera properly. Also, you must have some method of determining the "age" of a triangle to "know" which one is the oldest. Example smoke trails can be found in DUEL on my website. DUEL is coded in DBPro and is based on Lees tutorial 25 from DBC. Maybe one day I'll submit it to the showcase because it has lots of good things in it.

internet gaming group
Toothpick
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location:
Posted: 26th Nov 2003 22:48
If its just smoke you want you might get away with droping the smoke planes at the back of the ship. As the ship moves it would look like the smoke is triling the ship.

use the three plain trick so you dont need to point the smoke at the camera.

or you could link list the smoke and get a smoke pice to take the angle and positon of the smoke pice above it in the list.
feiting
22
Years of Service
User Offline
Joined: 19th Oct 2003
Location:
Posted: 26th Nov 2003 23:01
Andy, read what Waffle said.

I hoped you'd already know how to use arrays... and about hiding the object... well it's quite implied since you'll need to hide the missile already.

Toothpick has a cool idea too.

He who does not take the assassin job, will get killed by one who does.
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 26th Nov 2003 23:35
This solution would create a series of independant objects behind the emitter, which is fine for most effects but what I am aiming for is something akin to this as seen in Rory Mullane's rather excellent Hyperbowl Smash (http://ocean.ucc.ie/~rm2/3d/hyperbowl.php).



Note how each section links directly to the next, this picture below highlights how this linking is so important in relation to a smoke trail effect:



I cannot imagine a texture that would give a series of X primitives the same kind of visual impact, and that's why i'm hoping to figure out how to do a trail rather than a series of objects.

I have seen a similar effect in a tech demo by Pincho, perhaps if anyone has his contact details they would be kind enough to point him at this thread or to MSN me please? His demo was rather excellent but there was no source.


God created the world in 7 days, but we're still waiting for the patch.
zircher
23
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 26th Nov 2003 23:58
It seems like there are lots of ways to build a trail. The real trick is getting it to fade smoothly.
las6
23
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Finland
Posted: 27th Nov 2003 08:27 Edited at: 27th Nov 2003 08:32
you might be interested to check this out:
http://www.thegamecreators.com/?m=forum_view&t=20706&b=15
Cos you might be doing it the "right" way.

And you can find pincho from llrgt.

but what data are you really writing to the memblock?
shouldn't it be xyz/normalxyz/vertcol/uv?

Keyboard not detected. Press F1 to continue.
Toothpick
23
Years of Service
User Offline
Joined: 9th Feb 2003
Location:
Posted: 27th Nov 2003 15:29 Edited at: 27th Nov 2003 23:44
Here is a pic of the plain method,you cant see any brakes in the tial. looks fine when turning as well.(zoom in, the tail looks solid no?)





each bit of tail is two shapes like this >>
from the side view the arrow shape keeps things
looking nice while turning.

EDIT: just looked at the 3ds file, its just two plains at right angles to each other. NOT an arrow shape.
The trick is to overlap the pices so no brakes appear while turning.




I would give you the source code but I only have the dbc exe.

to fade the tail just texture each pice with a texture that is slightly more transparent than the last.
Andy Igoe
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 28th Nov 2003 03:54 Edited at: 28th Nov 2003 03:55
I've banged my head against the wall a few too many times now I just have not been able to get a working vector line system, instead I opted for a 'cloud' emmittor and the effect is ok, just more of a performance hit than I wanted to stomach unfortunately :/




God created the world in 7 days, but we're still waiting for the patch.
las6
23
Years of Service
User Offline
Joined: 2nd Sep 2002
Location: Finland
Posted: 28th Nov 2003 10:20 Edited at: 28th Nov 2003 10:23
@Andy Igoe
I believe the problem is still in the part where you write to the memblock. Or then I just can't figure out what data you are actually writing there.

But for starters, the DBpro memblock "mesh" stores the data in specific format and it looks like you are trying to write 3 vertex coordinates 5 times. can't figure that one out. If you want to write 3 vertices (that only makes a triangle...?) then you need to offset the address right.


@Toothpick
That screenie isn't the best way to show the system. Show us one where the trail is curved. Also, are you using real transparency there... plus if you overlap the pieces, won't it show up as nasty lines (brighter areas) where the pieces overlap.

Keyboard not detected. Press F1 to continue.

Login to post a reply

Server time is: 2026-07-27 01:32:38
Your offset time is: 2026-07-27 01:32:38