Page 1 of 1

Magic Particles 3D Usage

PostPosted: Wed Apr 03, 2013 11:53 pm
by JSanderson
Hey all.

We're having a problem using 3D emitters. When placing a 3D emitter, the position and rotation and scale seem to be incorrect. If we spawn a 2D emitter instead, giving it the same position, the 2D emitter shows up as expected.

Is there anything special that needs to be done to make 3D particles work correctly? We are using the 3D version of the library and have 2D particles working correctly in other places.

Help would be much appreciated.

Re: Magic Particles 3D Usage

PostPosted: Thu Apr 04, 2013 2:08 am
by Odin_KG
Hey

Perhaps you need to call Magic_SetViewMatrix for 3D. This function transfers the camera position to API.

Re: Magic Particles 3D Usage

PostPosted: Thu Apr 04, 2013 3:43 am
by JSanderson
Magic_SetViewMatrix is definitely being called. The same render path is taken through our code to render, all we do is change the emitter requested from the API. In the beginning of our render call, it always calls Magic_SetViewMatrix.

Do 2D particles not use the view matrix? If they do use the view matrix, then it would suggest that the view matrix is correct because a 2D emitter instead of a 3D emitter renders where I expect it to render.

Re: Magic Particles 3D Usage

PostPosted: Thu Apr 04, 2013 5:53 am
by Odin_KG
Do 2D particles not use the view matrix?

2D particles use the view matrix not always. It depends on the orientation of the surface of 2d particles. But you can check this situation easily if you do not call Magic_SetViewMatrix.

Re: Magic Particles 3D Usage

PostPosted: Thu Apr 04, 2013 11:38 pm
by JSanderson
If I do not call SetViewMatrix, the no particles draw on-screen - not even the 2D ones.

Are there any other ways that 3D particles work differently to 2D particles?

Re: Magic Particles 3D Usage

PostPosted: Fri Apr 05, 2013 1:40 am
by Odin_KG
Are there any other ways that 3D particles work differently to 2D particles?

It seems to me NO.

You may compare your code with the wrapper code: http://astralax.com/wrapper

Re: Magic Particles 3D Usage

PostPosted: Fri Jun 28, 2013 11:49 am
by jasmine78888
it is really nice post i like this info i appreciate this post keep it up......... :lol: