Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: phreak on December 06, 2002, 06:23:36 pm

Title: Beam helixes
Post by: phreak on December 06, 2002, 06:23:36 pm
I'm taking a break from graphics work to work on "Beam helixes".  In the few anime shows i've watched, i notices a few types of beams that have spirals around the central beam.  I'm trying to recreate such an effect in FS2.  Basically, the helix would spriral at three different modes

1 - sine wave (starts at zero, goes to maximum peak at 1/4 the period and minimum peak at 3/4 the period, crosses beams at 0, 1/2, 1)

2 - cosine wave (starts peaked, minimum at 1/2 the period; maximum at 0 and 1, crosses beam at 1/4, 3/4)

3 - spiral (helix stays fixed distance around beam, looks like a spring with a rod through the middle)
Title: Beam helixes
Post by: Solatar on December 06, 2002, 06:24:22 pm
Cool.:thepimp:
Title: Beam helixes
Post by: Bobboau on December 06, 2002, 06:28:05 pm
hmm... I was thinking about doing something like this,
but you can have it,
the trail code may have some stuff in it of use for getting started
Title: Beam helixes
Post by: Fetty on December 06, 2002, 06:36:49 pm
something like that with a beam in the middle ?
(i know it isnt a space sim :D )

edit : was a bit big ill do a link
click me :D (http://www.microsoft.com/Games/mw4mercs/img/ss_b_3.jpg)
Title: Beam helixes
Post by: phreak on December 06, 2002, 06:50:23 pm
that would be type three
Title: Beam helixes
Post by: Bobboau on December 06, 2002, 06:51:18 pm
that mech beam thing would actualy be rather easy to do
Title: Beam helixes
Post by: phreak on December 06, 2002, 06:57:41 pm
the effects i plan on doing won't work with beam tiling and translation.

basically - fire three beams, and have the two outer ones spiral around the middle one
Title: Beam helixes
Post by: Fetty on December 06, 2002, 07:02:57 pm
ugh that sounds rather complicated
Title: Beam helixes
Post by: Bobboau on December 06, 2002, 07:28:08 pm
Quote
Originally posted by PhReAk
the effects i plan on doing won't work with beam tiling and translation.


well that is understandable, odds are you're going to have to break the beam up into a whole buch of segments, and the tileing code would be hard to move into the rendering code for those segments,
though it may be a good idea to use the table entries for them to controle some things like the frequency of the helix and the speed at wich it moves,
the tileing entry has a flag for setting what sort of style you want.

but paresing code is extreemly simple so it doesn't realy mater
Title: Beam helixes
Post by: Corhellion on December 06, 2002, 09:50:45 pm
Quake 2 Rail gun looks something like that
Title: Beam helixes
Post by: Grey Wolf on December 06, 2002, 10:57:13 pm
Quote
Originally posted by Bobboau
that mech beam thing would actualy be rather easy to do
Actually, that's a Gauss Rifle. Nasty weapon, especially mounted in combo with 2 mounted w/ a Thunderbolt.....
Title: Beam helixes
Post by: Fetty on December 06, 2002, 11:03:43 pm
well i didnt want to go into detail:D (bgetter with 6erlarge btw:D )

but i got a question also
since im a complete , terrible and total newb about this
it also can be mod related idk :)
is it possible to have 3 beams joined up into 1 huge beam ? (like b5 excalibur...) that sounds similar to what your doing phreak
or im totaly wrong and in that case im gona jump out of the window :D
Title: Beam helixes
Post by: IceFire on December 07, 2002, 09:12:23 am
No, he wants a beam helix.  Ie....a central beam with a rotating beam around the outside that twists and turns through the center one.
Title: Beam helixes
Post by: Fetty on December 07, 2002, 12:37:06 pm
ye i understood that ;)
just another question from a noob :)
Title: Beam helixes
Post by: Solaufein on December 07, 2002, 01:20:51 pm
Might you be able to something like that with the lightning code(from the nebula), Or you might create a new nebula only weapon with lightning effects.

Just a thought
Title: Beam helixes
Post by: Sesquipedalian on December 07, 2002, 02:13:34 pm
Having tinkered with the beam tiling and translation code a fair bit, I think one and two could easily be done with the code as it is now if the rate at which flickering happens could be set by a table value.  Number 3 is a bit tougher if you want the helices to actually respond in 3d to the position of the player like in the pic Fetty posted, since beams right now render in 2D.

But with precise control of the flicker rate, all one would need is an image of a sine wave or cosine wave with which to flicker (since flickering is simply the widening and narrowing of a beam section)
Title: Re: Beam helixes
Post by: TrashMan on December 08, 2002, 03:20:42 pm
Quote
Originally posted by PhReAk
I'm taking a break from graphics work to work on "Beam helixes".  In the few anime shows i've watched, i notices a few types of beams that have spirals around the central beam.  I'm trying to recreate such an effect in FS2.  Basically, the helix would spriral at three different modes


Which shows?

and I like the idea!
Title: Re: Re: Beam helixes
Post by: phreak on December 08, 2002, 03:48:33 pm
Quote
Originally posted by TrashMan

Which shows?
 


DBZ mostly
Title: Beam helixes
Post by: Killfrenzy on December 09, 2002, 05:53:15 am
Vandread uses them as well.....I think.

But if you can do these helixes (as well as keeping the original beams) I can put them to VERY good use! :D
Title: Beam helixes
Post by: phreak on December 09, 2002, 08:40:47 pm
most likely i will have a working demo up by friday (hopefully earlier).

nothing special, just beams with lines twirling around them just to demonstrate the idea.  I will supply instructions on how to add helixes to a beam.
Title: Beam helixes
Post by: LtNarol on December 09, 2002, 08:57:09 pm
isnt there an easier way to do this? like have the beam map tiled and translate in the direction in which the beam is 'shot'?  Then all you have to do to get different effects is change the map; which would look smoother anyways.  Some upsides is that it could be useful for other kinds of beam stuff as well ;)
Title: Beam helixes
Post by: Sesquipedalian on December 10, 2002, 01:48:54 pm
That's what I was saying for the sine and cosine waves, Lt. Narol.  The helices (no, that's not a typo) can't work the same way, because they have to be 3D to look right.
Title: Beam helixes
Post by: Bobboau on December 10, 2002, 07:50:04 pm
this could be very cool, and the code could be used to improve other things like the damage archs
Title: Beam helixes
Post by: Anaz on December 13, 2002, 01:35:16 pm
My friend and I worked out some stuff for the z position of the beam:

z = sin(x) + sqrt(-(y * y));

Hope that helps!
Title: Beam helixes
Post by: Goober5000 on December 13, 2002, 02:06:36 pm
Quote
Originally posted by Analazon
z = sin(x) + sqrt(-(y * y));


I didn't know fs2_open could handle imaginary numbers. :wtf: ;)
Title: Beam helixes
Post by: Rampage on December 13, 2002, 03:32:47 pm
Quote
Originally posted by Analazon
My friend and I worked out some stuff for the z position of the beam:

z = sin(x) + sqrt(-(y * y));

Hope that helps!


Nah!  Try using vector graphs.

r(t)=2cos(t)i+2sin(t)j+tk

Vectors rule!
Title: Beam helixes
Post by: Anaz on December 13, 2002, 04:50:14 pm
Quote
Originally posted by Rampage


Nah!  Try using vector graphs.

r(t)=2cos(t)i+2sin(t)j+tk

Vectors rule!


meh....I'm not familiar with how DirectX works...and this was a 30 second thing. I think the - needs to be moved outside of the sqrt() in what I wrote...
Title: Beam helixes
Post by: Goober5000 on December 13, 2002, 05:00:07 pm
That would make more sense.  In your first formula, you were taking the square root of a negative number. :)