sprocket
Messages : 2 Date d'inscription : 2009-12-03
| Subject: irrlicht and rain Thu Dec 03, 2009 4:14 am | |
| I am trying to run the rain example in irrlicht. I managed to make it work but i have 2 main problems. To make the rain follow the fps camera i use this code in the while loop: - Code:
-
rainZone->setPosition(Vector3D(cam.X,5.0f,cam.Z)); This actually works but it has a delay and i cannot see the rain when i move. Also when the reposition is complete i cannot see the rain in a particular range when i rotate my camera. My second problem is that from time to time it starts appearing some strange artifacts and it doesn' t stop unless i restart the program. Any ideas?? Great job btw! I really like your library! | |
|
Juff Developer
Messages : 539 Date d'inscription : 2009-07-14 Age : 42
| Subject: Re: irrlicht and rain Thu Dec 03, 2009 1:00 pm | |
| Hi, first of all, are you using the latest svn version ? The Irlicht module of the version 1.04.00 was the first one and it has a fews bugs. You can download the latest version directly from here. For the delay, it is normal, you got to tune the system so that it follows the camera. If their is too much delay, you can increase the radius of the ring used to generate the rain (it is not a ring but a aabox in the previous rain demo in 1.04), increase the gravity so that the drops falls faster, lower the altitude of the ring, increase the density of the fog so that we see less far... it is all a matter of tuning. Another way of not having a delay at all, is making the entire system relative to the camera. You can enable that when constructing an irrsystem (by setting worldTransformed to false). In that case, when moving the irrsystem like any other node, the whole particles will move with it. So instead of moving only the zone, move the entire system. It can work for for example car games where the camera is moving very fast but with camera moving more slower, their will be no delay but the effect wont be that good (as the drops are moving with the camra). For you other issues try to use the new version and tell me if you still got problems. | |
|
sprocket
Messages : 2 Date d'inscription : 2009-12-03
| Subject: Re: irrlicht and rain Thu Dec 10, 2009 2:51 pm | |
| Thank you for your fast replay. I get what u mean about the delay. I thought that i was missing something because it rains so good in your non-irrlicht example The problem with the strange triangles that appear some times is not solved. I am using the last svn version of spark and irrlicht 1.6 I also found another problem. When i increase the rainRatio, after 24/100 (i think..) the program crashes or some times i just cant see the rain untill i decrease the ratio (the splashes and the drops are still visible) That does not happen if i comment out the dropgroup in the killrain function but the rain is not complete without the drops - Code:
-
bool killRain(Particle& particle,float deltaTime) { if (particle.position().y <= -2.0f) { particle.position().set(particle.position().x,-2.01f,particle.position().z); splashGroup->addParticles(1,particle.position(),Vector3D()); //dropGroup->addParticles(param(2,8),particle.position(),dropEmitter); return true; } return false; } | |
|
Juff Developer
Messages : 539 Date d'inscription : 2009-07-14 Age : 42
| Subject: Re: irrlicht and rain Mon Dec 14, 2009 11:25 am | |
| Hi, sorry for the late replys (i was quite busy those days)
Regarding the crash, it seems it is a problem with the validity of the dropEmitter pointer. The pointer must be valid at all times when the system is running.
For the problem with strange triangles, this is weird. Can you get a minimal code example that reproduces the issue so I can test it on my side ? | |
|
Sponsored content
| Subject: Re: irrlicht and rain | |
| |
|