Hey,
I tried to implement a new feature into my patheditor. It should give the possibilty to "export" paths from modeling programs into gamestudio. The idea is the following:
- In the modeling software render a path with triangles:
http://dl.dropbox.com/u/6859456/3dgs/Bild_2.bmp
- Load it in gamestudio and run my script:
Php Code:
for(int i;i<vertexcount;i+=3)
{
	you=nodeCreate();
	vec_set(you.x,	vec_for_vertex(ver1,ent,i+2));
	vec_for_vertex(ver3,ent,i);	
	vec_for_vertex(ver1,ent,i+1);
	vec_for_vertex(ver2,ent,i+2);
	vec_set(tmpVec,ver1.x);	
	vec_add(tmpVec,ver2.x);
	vec_scale(tmpVec,0.5);
	
	vec_set(panDir,ver1.x);
	vec_sub(panDir,ver2.x);
	
	vec_to_angle(tmpAng,panDir);
	you.pan=tmpAng.pan;
	you.tilt=tmpAng.tilt;
	
	vec_sub(tmpVec,ver3);
	vec_cross(panDir,panDir,tmpVec);
	vec_to_angle(tmpAng,panDir);
	you.roll=tmpAng.tilt;
} 




Everything works fine, but when the tilt value comes nearer to -90, the pan value plays crazy(it gets from 180 to 0) and the tilt value goes back instead of continuing (so it is in inverse roation). It is difficult to explain, but I think this guy here had the same problem:
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=166452

regards Alain


Last edited by krial057; 01/29/12 12:42.