Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Akow), 1,371 guests, and 10 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Trail angle problems [Re: Razoron] #319004
04/11/10 13:20
04/11/10 13:20
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
Of course it wont work, you attach the trail to airplane's base coordinate.
If you want to attach it to your plane's wing you should use:
Code:
vec_for_vertex (trail.x, _my_plane_entity, wing_vertex);


wing_vertex is the vertex located in your model(in the wing) that you want your trail attached. You can see it in Med.

Re: Trail angle problems [Re: bart_the_13th] #319079
04/12/10 07:01
04/12/10 07:01
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline OP
Senior Member
Razoron  Offline OP
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
Yes, i want to attack the trail to the plane's base coordinate. The left up corner should go with the left wing and the right up corner of the trail with the right wing.

Re: Trail angle problems [Re: Razoron] #319356
04/14/10 13:05
04/14/10 13:05
Joined: May 2009
Posts: 445
Peine, Germany
Razoron Offline OP
Senior Member
Razoron  Offline OP
Senior Member

Joined: May 2009
Posts: 445
Peine, Germany
*baamp*

Re: Trail angle problems [Re: Razoron] #324036
05/19/10 04:40
05/19/10 04:40
Joined: Dec 2007
Posts: 706
Schortens Germany
Landixus Offline
User
Landixus  Offline
User

Joined: Dec 2007
Posts: 706
Schortens Germany
Code:
#define TRAIL_VERTEX_1 skill6 // An diesem Vertex werden die "Abreisspartikel" eines Tragflächenendes erstellt
#define TRAIL_VERTEX_2 skill7 // An diesem Vertex werden die "Abreisspartikel" eines Tragflächenendes erstellt


Code:
// Partikelfunktionen
function fade_particles(PARTICLE *p)
{
	p.alpha -= 5 * time_step;
	if (p.alpha < 0) {p.lifespan = 0;}
}
function particle_trail(PARTICLE *p)
{
	var ptemp;
	p->vel_x = 0;
	p->vel_y = 0;
	p->vel_z = 0;
	p.alpha = 70;
	p.bmap = ptrail_tga;
	p.size = 10;
	p.flags |= (BRIGHT | MOVE | BEAM);
	p.lifespan = 30;
	p.event = fade_particles;
}
function PlTrailParticlesFade(PARTICLE* p) // "Abreisspartikel" am Tragflächenende ausfaden
{
	p.alpha-= time_step; // partikel ausfaden
	p.size-= time_step; // partikel verkleinern
	if(p.alpha <= 0 || p.size <= 0){p.lifespan = 0;} // partikel entfernen
}

function PlTrailParticles(PARTICLE* p) // "Abreisspartikel" am Tragflächenende
{
	p.bmap = bmpWingTrailParticle;
	p.size = random(0.5)+0.5; // zufällige größe
	p.alpha = random(10)+10; // zufällige transparenz
	p.vel_x+= (random(-1)+0.5)*time_step; // zufäliges zerstreuen
	p.vel_y+= (random(-1)+0.5)*time_step;
	p.vel_z+= (random(-1)+0.5)*time_step;
	p.flags |= (STREAK | TRANSLUCENT); // particel als durchsichtigen trail rendern
	p.event = PlTrailParticlesFade; // partikel ausfaden
}



function vec_randomize (var* vec, var range) // Partikel Beschleunigungsvektor auf zufällige Richtung und Länge setzen
{
   vec[0] = random(1) - 0.5; //  Richtung setzen / -0.5....0.5
   vec[1] = random(1) - 0.5; 
   vec[2] = random(1) - 0.5;
   vec_normalize(vec,random(range)); // Länge setzen
}

function part_alphafade(PARTICLE *p) // Partikel ausblenden
{
   p.alpha-= 2*time_step; // alphawert verringern
   p.size+= 2*time_step;
   if (p.alpha <= 0){p.lifespan = 0;} // partikel entfernen wenn alpha kleiner oder gleich null
}



In der Steuerung irgendow:
Code:
vec_for_vertex(vLastPos1, my, my.TRAIL_VERTEX_1); // aktuelle Vertexposition am ersten Tragflächenende auslesen
			vec_for_vertex(vLastPos2, my, my.TRAIL_VERTEX_2); // aktuelle Vertexposition am zweiten Tragflächenende auslesen



Code:
vec_for_vertex(vVertexPos1, my, my.TRAIL_VERTEX_1); // Aktuelle Vertexposition am ersten Tragflächenende auslesen
			vec_sub(vLastPos1,vVertexPos1); // Differenz zwischen alter und neuer position berechnen
			vec_scale(vLastPos1, 3); // Erhaltenen richtungsvektor skalieren
			effect(PlTrailParticles, 1, vVertexPos1, vLastPos1); // Partikel am Tragflächenende erschaffen und mit richtungsvektor beschleunigen
			
			vec_for_vertex(vVertexPos2, my, my.TRAIL_VERTEX_2); // Wie oben, nur am anderen Tragflächenende
			vec_sub(vLastPos2,vVertexPos2);
			vec_scale(vLastPos2, 3);
			effect(PlTrailParticles, 1, vVertexPos2, vLastPos2);
			wait(1);



Das sollte dir auf jedefall helfen.

Frag mich doch einfach

Last edited by Landixus; 05/19/10 04:45.

My Blog German: http://blog.quakeit.de/
www.quakeit.de ||
Airfix Game in Cooperation with:
www.3drt.com
Models Levels and Textures
Page 2 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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