Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

 

 Questions about rotation and 3D rendering

Go down 
2 posters
AuthorMessage
MonRoyal




Messages : 6
Date d'inscription : 2011-11-17

Questions about rotation and 3D rendering Empty
PostSubject: Questions about rotation and 3D rendering   Questions about rotation and 3D rendering Icon_minitimeThu Nov 17, 2011 3:46 pm

Hello,

first thank you for the great tool you provide! I'm trying to use the spark 2 particle engine in my own game engine for mobile devices.
I need to write my own renderer, so that the particles fit to my render engine (Marmalade SDK). I'm using the 3D render api from Marmalade but I'm only creating 2D games right now. So I don't set any special world/view transformations. I'm using screenspace directly.

So here are my questions:
1) Why is there only one rotation per particle? In my understanding there should be 3 roation angles per particle, with one for each axis. Or is there any fixed rotation axis?
2) I have a hard time to understand your GLQuadRenderer. Can you explain what transformations you are doing there? Why do you need an inverted model view matrix?
3) In which cases can you compute the up- and side- vectors (Oriented3DBehaviour) only once for an group? In this cases all particles have exactly the same orientation in the space. Is this correct?
4) If I have the particle positions and if I know how to achieve the rotation I could easily transform the vertices two the 2D screenspace. You don't need to invert the model view matrix and so on. Or do I miss anything here?

Best Regards
Damir
Back to top Go down
Juff
Developer



Messages : 539
Date d'inscription : 2009-07-14
Age : 42

Questions about rotation and 3D rendering Empty
PostSubject: Re: Questions about rotation and 3D rendering   Questions about rotation and 3D rendering Icon_minitimeThu Nov 17, 2011 7:23 pm

I thanks for your interest.

To answer you questions :

1/ The orientation defines the orientation around the normal of the image plane (the orientation of the image in 2D space). The orientation of the particle (meaning to where points the normal of the image) is defined in the renderer by a custom policy : Will the particles look towards camera, or a point in the space, or will the orientation follow the direction in where the particles moves... Basically, the angle of a particle is just an offset of the orientation of the particle around its look vector. There could have been one around the up and side vector too but it is not relevant to my opinion (in case of particles made of 3D models it may become so though)

2/ Because I need the camera transform to get the camera position and orientation which is the inverse of the modelview. But actually I dont really need to invert the modelview to orientate particles, I could do without and this can be optimized.
Anyway once a have the camera transform, I orientate billboards using it (depending on orientation policy)

3/ In case where it can be : For instance you can defines an axis for the orientation directly (imagine circles on a ground due to a rain drops for instance) or you can fasten the computation of billboards by having them looking towards the frustum near plane instead of the camera point (the effect will be quite similar except some slight distortion at the borders). In general everything which is marked as fast in the doc of LookOrientation and UpOrientation needs only one computation per render for all particles in the group. In this case, the look axis of all particles will be the same but they can still be rotated around it (2D rotation of the image)

4/ In 2D it is simpler, you dont need any modelview as you dont care where the camera is and you know where to look to face the camera. Particles facing the camera will have a look vector of unit z and a up vector of unit y (depending on how you set up your view thou)

Hope this helps. Dont hesistate if you have further questions

PS : To get a good overview of what kind of orientation policies can be set up with SPARK, I suggest you take a look at the explosion demo of SPARK 1
Back to top Go down
http://spark.developpez.com
 
Questions about rotation and 3D rendering
Back to top 
Page 1 of 1
 Similar topics
-
» Questions about SPARK (2)
» License questions
» rendering text using particles (make zone from bitmap)
» [SPARK2] Questions about Graph Entries and SPKObject::copy
» Questions and help

Permissions in this forum:You cannot reply to topics in this forum
 :: English Forum :: Questions (en)-
Jump to: