0
\$\begingroup\$

Im using ANDEngine and wants to create confetti particle system.

But im unable to make flipping and rotation of confetti particle around z-axis Since andengine is 2d engine, it doesnot support that.

However like in the following example , 3d rotation has been implemented for a single sprite:

http://code.google.com/p/andengineexamples/source/browse/src/org/anddev/andengine/examples/Rotation3DExample.java

I want to do this for the particles. Am i missing something ? or do i hv to modify the particle system code.

\$\endgroup\$
  • \$\begingroup\$ What's the problem? Have you tried doing it for the particles? How to modify a library to add additional features is a bit too broad a question for this site. You should try adding the rotation and if you come up against a specific problem, as that question here. \$\endgroup\$ – MichaelHouse Aug 30 '13 at 14:09
  • \$\begingroup\$ I have done the rotation thing. But since it is the 2d engine , i cannot rotate on z axis, For rotation on z-axis, u have to modify your sprite's applyRotation method as i have mentioned in my link of andengine example. I want to create flipping effect on particles. which can only be done via 3d rotation \$\endgroup\$ – asma.farhat Aug 31 '13 at 12:56
  • \$\begingroup\$ Actually it would be possible to simulate that with some very clever scaling. \$\endgroup\$ – MichaelHouse Aug 31 '13 at 14:22
  • \$\begingroup\$ I found this written smwhere in stackoverflow , i guess this is the same as ur telling : A simple approach is to scale the Sprite as it moves back in distance. Just treat the scale property as a Z depth. But beware of Z-sorting (when items in depth overlap). In a simple game like paper toss this will not be a problem. But for example, if your object passes through a hoop, you will find it gets hard to manage. \$\endgroup\$ – asma.farhat Aug 31 '13 at 14:41
  • \$\begingroup\$ Just use rotation like the example you linked shows: pGL.glRotatef(rotation, 0, 1, 0); Where rotation is the amount to want to rotate and the last three values define the axis of rotation. \$\endgroup\$ – MichaelHouse Aug 31 '13 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.