Trail angle problems

Posted By: Razoron

Trail angle problems - 04/10/10 19:22

Hi,
i have some problems with the angels of the trail of my plane. At the moment i set the angels like this:
Code:
trail.pan=my.pan;
trail.tilt=my.tilt-90;
trail.roll=my.roll;
vec_set(trail.x,my.x);


But it doesn't fit. The edges of the trail don't fit to wings.
Here is a little video: DOWNLOAD
Thanks in advance.
Posted By: Widi

Re: Trail angle problems - 04/10/10 21:13

Downloadlink don`t work...
Something about your code: You can replace

trail.pan=my.pan;
trail.tilt=my.tilt-90;
trail.roll=my.roll;

with:

vec_set(trail.pan,my.pan);
Posted By: Razoron

Re: Trail angle problems - 04/11/10 11:04

The download link IS working, i just tried it.
I will test your suggestion.
Posted By: Anonymous

Re: Trail angle problems - 04/11/10 11:51

This is a ANGLE. You can't use vector expression. Try this again;

vec_set(trail.pan,my.pan) and delete "trail.pan=my.pan" expression...

Or,

vec_set(trail.tilt,my.tilt) and delete "trail.tilt=my.tilt" expression...

Or,

vec_set(trail.roll,my.roll) and delete "trail.roll=my.roll" expression...


If you want to play x plane, define a vector.
Posted By: Rei_Ayanami

Re: Trail angle problems - 04/11/10 11:54

@Fast_System : Please be informed before you post such stupid and senseless post! Vector expressions work with vec_set but what you wrote won't work!

@Razoron: Is your airplane a physics object?
Posted By: Anonymous

Re: Trail angle problems - 04/11/10 11:58

Originally Posted By: Rei_Ayanami
@Fast_System : Please be informed before you post such stupid and senseless post! Vector expressions work with vec_set but what you wrote won't work!


My English isn't good you may have misunderstood my message.
Posted By: Rei_Ayanami

Re: Trail angle problems - 04/11/10 12:00

No, i understood you right wink

"This is a ANGLE. You can't use vector expression. Try this again;"

but he can, it will work wink


but such won't work:

"vec_set(trail.tilt,my.tilt);"
Posted By: Widi

Re: Trail angle problems - 04/11/10 12:21

@Fast_System: Yes you are really false. If you use
vec_set(my.pan,you.pan);
then the Engine do following:

vector1[0] = vector2[0]; // pan or x or red
vector1[1] = vector2[1]; // tilt or y or green
vector1[2] = vector2[2]; // roll or z or blue

The pan / tilt / roll or red / green / blue are notting other than a Vector (Vector = array that contains 3 values)

EDIT: have a look in the manual before you writing someting false.
Posted By: Anonymous

Re: Trail angle problems - 04/11/10 12:32

I may have misunderstood the question.Because vectors have 3 kinds of information about that. I'm sorry for mistakes... frown
Posted By: Razoron

Re: Trail angle problems - 04/11/10 12:59

Originally Posted By: Rei_Ayanami

@Razoron: Is your airplane a physics object?

No, it isn't. I move it with c_move and c_rotate.
Posted By: bart_the_13th

Re: Trail angle problems - 04/11/10 13:20

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.
Posted By: Razoron

Re: Trail angle problems - 04/12/10 07:01

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.
Posted By: Razoron

Re: Trail angle problems - 04/14/10 13:05

*baamp*
Posted By: Landixus

Re: Trail angle problems - 05/19/10 04:40

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
© 2024 lite-C Forums