Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AbrahamR, wdlmaster, 7th_zorro, dr_panther, 1 invisible), 764 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Spreading the effect between two vertex #290979
09/22/09 18:20
09/22/09 18:20
Joined: Oct 2006
Posts: 470
Balkan
Ganderoleg Offline OP
Senior Member
Ganderoleg  Offline OP
Senior Member

Joined: Oct 2006
Posts: 470
Balkan
Hello,
I was wondering if someone could help me with spreading the effect between two vertex in a straight line ?

I tried to use vec_for_vertex with vec_diff and vec_normalize but didn't get it right.
All I achieved is to place(not to spread) effect between two vertex in a triangle-sort-of-way.
Thanx.

Btw: I am using C-Script.

Last edited by Ganderoleg; 09/22/09 18:22.

>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<

Re: Spreading the effect between two vertex [Re: Ganderoleg] #291003
09/22/09 20:37
09/22/09 20:37
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
Hey Ganderoleg,
I've got absolutely no idea where you're talking about... ^^°

Is it possible that you are not talking about shaders, but about particle effect you want to be a line from one vertex to another?

Could you please describe more exactly what you want to achieve? Maybe give an example, where you need it for or show a picture

Confused
Scorpion

Re: Spreading the effect between two vertex [Re: Scorpion] #291010
09/22/09 21:38
09/22/09 21:38
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
If you mean particle:

Code:
VECTOR Temp_vec1;
VECTOR Temp_vec2;
VECTOR Temp_vec2;

void WAFFEN_FX_FEUER(vertex_1,vertex_2) 
{
	while (my)
	{
		if (!is_e(my,CLIPPED))
		{
			vec_for_vertex (Temp_vec1,my,vertex_1);
			vec_for_vertex (Temp_vec2,my,vertex_2);
			for (i = 0;i < 5;i ++)
			{
				vec_lerp (Temp_vec3,Temp_vec1,Temp_vec2,random(1));
				effect (WAFFE_ROT_PAR,4 * time,Temp_vec3,normal);
				effect (WAFFE_FEUER_PAR,4 * time,Temp_vec3,normal);
			}
		}
		wait(1);
	}
}



So the effect shows up at a random position between the 2 vertices

Last edited by Widi; 09/22/09 21:41.
Re: Spreading the effect between two vertex [Re: Widi] #291018
09/22/09 23:10
09/22/09 23:10
Joined: Oct 2006
Posts: 470
Balkan
Ganderoleg Offline OP
Senior Member
Ganderoleg  Offline OP
Senior Member

Joined: Oct 2006
Posts: 470
Balkan
Particles smile
I need X number of particles to populate a distance from vertex1 to vertex2 on mdl object.
The embarrassing part is that I'm already using that effect through script written by programmer signed as John (FlyingSword.wdl). It's just that I couldn't clone it fast and it should be just a few lines of code. So I thought I ask.

This is the function that I think is responsible for light-effect on sword:

FUNCTION LightSword(){
//"Magic, glowy, sparkly, ooh" effect
vec_for_vertex(PointVec,my,vektor_1); //Sword Point, if you use a different model be sure to change the vertex
Vec_for_vertex(tempvec,my,vektor_2); //Sword Hilt, if you use a different model be sure to change the vertex
BladeLength = vec_dist(PointVec.x,tempvec.x); //My game uses varying sword lengths so I check the length each Time
OrbitPlayerMin=MAX(BladeLength*2,70); //Set the orbitplayer distances based on the sword length
OrbitPlayerMax=MIN(BladeLength*3,80);

vec_diff(tempangle,PointVec.x,tempvec.x); //Set tempangle to point from the hilt to the point
effectcounter = BladeLength/2; //Calculate the number of effects we need to light the sword
vec_normalize(tempangle,2); //normalize(reduce) the distance of tempangle to 2, we add
//tempangle to the last effect position to calculate the
//next effect position

WHILE((effectCounter>0)&&(partix==1))
{
effect(SwordPlasma_effect,2,tempvec,tempvec); //generate a plasma effect along the sword blade
vec_add(tempvec.x,tempangle.x); //calculate the position to generate the next effect
effectcounter -=1; //decrement the effect counter
}
}


@Widi
I will try the code but I believe it's in Lite-C. Will it work if I change it to C-Script(void to function etc.)?


>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<

Re: Spreading the effect between two vertex [Re: Ganderoleg] #291019
09/22/09 23:21
09/22/09 23:21
Joined: Oct 2006
Posts: 470
Balkan
Ganderoleg Offline OP
Senior Member
Ganderoleg  Offline OP
Senior Member

Joined: Oct 2006
Posts: 470
Balkan
This is the link to download original wdl script:

http://www.opserver.de/coni_users/web_users/pirvu/au/scripts/FlyingSword.zip

It's from Acknex Unlimited / WDL&DLLs page.


>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<

Re: Spreading the effect between two vertex [Re: Ganderoleg] #291080
09/23/09 11:28
09/23/09 11:28
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
You can change "void" to "function", but i dont know moore about c-script.

Have a look at the line

vec_lerp (Temp_vec3,Temp_vec1,Temp_vec2,random(1));

from my Code. vec_lerp gives you a random Point (Temp_vec3) between the two Points (Temp_vec1 and Temp_vec2).

I use this code also to show up a sword particleeffect.

Last edited by Widi; 09/23/09 11:28.
Re: Spreading the effect between two vertex [Re: Widi] #291094
09/23/09 12:28
09/23/09 12:28
Joined: Oct 2006
Posts: 470
Balkan
Ganderoleg Offline OP
Senior Member
Ganderoleg  Offline OP
Senior Member

Joined: Oct 2006
Posts: 470
Balkan
This code works great! smile
All I needed to do is lose for (works only in Lite-C)

I placed it in my sword function:
while (1)
{
vec_for_vertex(ringmvert_a, my, 6);
vec_for_vertex(ringmvert_b, my, 9);

vec_lerp (ringmost_a,ringmvert_a,ringmvert_b,random(1));
effect(mana_cspezial,max(1,mana_cAnzahlPartikel*time),ringmost_a,normal);
vec_lerp (ringmost_a,ringmvert_a,ringmvert_b,random(1));
effect(mana_cspezial,max(1,mana_cAnzahlPartikel*time),ringmost_a,normal);
vec_lerp (ringmost_a,ringmvert_a,ringmvert_b,random(1));
effect(mana_cspezial,max(1,mana_cAnzahlPartikel*time),ringmost_a,normal);
wait(1);
}

Btw- I forgotten the way on how to make random more randomized so I placed vec_lerp after each effect. Without it they all go in a same rhythm and in the same move-path(even in a same direction).

Thanx for code Widi.You really helped me out.


>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<

Re: Spreading the effect between two vertex [Re: Ganderoleg] #291112
09/23/09 13:29
09/23/09 13:29
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany

Re: Spreading the effect between two vertex [Re: Pappenheimer] #291116
09/23/09 13:45
09/23/09 13:45
Joined: Oct 2006
Posts: 470
Balkan
Ganderoleg Offline OP
Senior Member
Ganderoleg  Offline OP
Senior Member

Joined: Oct 2006
Posts: 470
Balkan
Just the thing I needed smile Thanx Pappenheimer.


>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<


Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1