Posted By: VeT
Particles on the screen [SOLVED] - 04/19/09 13:12
Okay, as Jcl said( http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=261620#Post261620 ), i'm trying to
You can solve this problem already in world coordinates, in the particle function:
- get the distance vector from the camera to the particle
- rotate this vector by the same euler angle you added to the camera angle.
- get the distance vector from the rotated vector to the original vector
- add this new distance vector to the particle position.
This should keep your particles in front of the camera regardless of the rotation.
i tried
but looking like i missed something ((
PS: I based on the particle flame http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=220514#Post220514
Quote:
You can solve this problem already in world coordinates, in the particle function:
- get the distance vector from the camera to the particle
- rotate this vector by the same euler angle you added to the camera angle.
- get the distance vector from the rotated vector to the original vector
- add this new distance vector to the particle position.
This should keep your particles in front of the camera regardless of the rotation.
i tried
Code:
var tVec[3]; var tVec2[3]; vec_diff(tVec,p.x,camera.x); vec_rotate(tVec,camera.pan); vec_diff(tVec2,p.x,tVec); vec_add(p.x,tVec2);
but looking like i missed something ((
PS: I based on the particle flame http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=220514#Post220514