Skreamz
Messages : 9 Date d'inscription : 2011-01-27
| Subject: 2D in irrlicht Thu Jan 27, 2011 6:49 am | |
| hi there, I've ported the explosion demo to Irrlicht, I'm using both Spark with Irrlicht for an 2D Android game, the demo works as it should. but when using it with and ortho projection, i have to SetSize within the renderer by at least 30 to see anything, and not all particles are always visible, as there anything that should be set in particular when work in a 2D environment?
Thanks.
btw, fantastic engine. | |
|
Juff Developer
Messages : 539 Date d'inscription : 2009-07-14 Age : 42
| Subject: Re: 2D in irrlicht Thu Jan 27, 2011 11:05 am | |
| Hi, well everything depends on your projection matrix. I guess your ortho view maps the universe on the screen, which means one unit in the universe is one pixel on the screen. So you definitely need to scale the system. Setting the setSize is not enough to scale the system. Actually you can use 2 methods to do it : - The simple one is to have the particles emitted in local space (set his when constructiong an IRRSystem) and then apply a scale on the system transform (like any other IRRSceneNode). This will work but all geometry info within the system will not be in world space, meaning your particles cannot interact with objets in the universe (collision or anything)
- The second method is to use world space particles and to scale every data that is using distance accordingly : ie position, length, radius, forces (which are in N -> kg.m.s^-2)... It is not very convenient but its the only way. In SPARk 2 a helper method would do that for you.
As for the particles not appearing, I guess it is a problem with clipping planes. Be sure to set the clipping planes so that particles are visible no matter their z. When using a standard ortho, clipping planes are usually set to -1 and +1. In fact we really dont care for 2D are objects are always renderered at z = 0. But with SPARK, systems evolves in 3D unless you designed your system so that it only evolve in x and y. Hope this helps. | |
|
Skreamz
Messages : 9 Date d'inscription : 2011-01-27
| Subject: Re: 2D in irrlicht Thu Jan 27, 2011 11:47 am | |
| Thanks, was a great help, working just the way I wanted it.
Thanks again. | |
|
Warlock
Messages : 1 Date d'inscription : 2012-01-08
| Subject: Re: 2D in irrlicht Wed Jan 25, 2012 7:17 am | |
| Hi there, we've ported SPARk 2 to use in Android 2D game and we have the same problem as described here.
You said there is helper method that can help us to scale position,length... Please can you explain how to use this method or just where can we find it?
Thanks. | |
|
Juff Developer
Messages : 539 Date d'inscription : 2009-07-14 Age : 42
| Subject: Re: 2D in irrlicht Wed Jan 25, 2012 8:29 am | |
| Hi,
If I understand well, you ve got a scale issue ? You have ported some of the particle systems from demos and there are way 2 small in 2D ? Can you post a screenshot of what is rendering by explaining what you want to achieve ?
Thanks | |
|
Sponsored content
| Subject: Re: 2D in irrlicht | |
| |
|