float x_fac = 1.000;
float y_fac = cos(view_angle);
float z_fac = sin(view_angle);
screen_x = x_fac*particle.pos_x;
screen_y = y_fac*particle.pos_y + z_fac*particle.pos_z;
</pre>
I guess Im not getting the view_angle. Is it where the camera is, like 90 would be straight overhead (well 90/360 * 2PI)?
In the quick test I made, I just set the x velocity to +2 and the y velocity to +1 (and left Z velocity at 0). This should make a particle that "follows" along the edges of a 64x32 traingle (if that makes sense…).
But that didnt work out, it moved at a different angle, I assume its because the way Im converting the 3D cords to 2D.
Can someone explain this better to me? I think Im pretty confused…
Thanks
Ratman </i>
—————
<A href="http://ratfest.org ">Ratfest.org</a>
More Particle Systems
I finally got around to putting in a particle system for my ISO engine. Im having a little trouble grasping the whole 3D to 2D system though...
Someone told me to do it like this:
July 08, 2001 03:18 PM
I see what you are trying, I would do something closer to:
|
The above implementation assumes y is positive going southward, negative going northward. It assumes z is positive going downward, and negative going upwards. It also assumes your particles at x=0,y=0,z=0 is the center of the screen. Keep that in mind.
The variable view_angle is the angle of the virtual camera up from the ground, I would set it somewhere between 30-60. I''ve modified the code, so it converts to radians, in case you weren''t doing that.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement