HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log inLog in  

Share | 

 Implementing rain example with irrlicht

Go down 

Messages : 1
Date d'inscription : 2012-01-06

PostSubject: Implementing rain example with irrlicht   Fri Jan 06, 2012 11:34 am


first of all thanks do the developers of Spark, it´s really useful Smile

To my current problem:

I´m trying to implement the rain example with irrlicht, but currenty I can´t see any effect of it, it´s totally invisible. Here is what I do:

Setting up the hole thing

          //Inits Particle Engine
   Vector3D gravity = Vector3D(0.0f,-2.0f,0.0f);

   // Renderers

   float sizeRatio = 1.2;

   IRR::IRRPointRenderer* basicRenderer = IRR::IRRPointRenderer::create(Main->GetDevice());

   // point renderer
   IRR::IRRPointRenderer* dropRenderer = IRR::IRRPointRenderer::create(Main->GetDevice());
   dropRenderer->setSize(2.0f * sizeRatio);

   // line renderer
   IRR::IRRLineRenderer* rainRenderer = IRR::IRRLineRenderer::create(Main->GetDevice());

   // quad renderer
   IRR::IRRQuadRenderer* splashRenderer = IRR::IRRQuadRenderer::create(Main->GetDevice());
   // Models
   // rain model
   Model* rainModel = Model::create(FLAG_GREEN | FLAG_RED | FLAG_BLUE | FLAG_ALPHA | FLAG_MASS,


   // drop model
   Model* dropModel = Model::create(FLAG_GREEN | FLAG_RED | FLAG_BLUE | FLAG_ALPHA | FLAG_MASS,


   // splash model
   Model* splashModel = Model::create(FLAG_GREEN | FLAG_RED | FLAG_BLUE | FLAG_ALPHA | FLAG_SIZE | FLAG_ANGLE,

   splashModel->setParam(PARAM_ANGLE,0.0f,2.0f * PI);

   // rain emitter
   //AABox* rainZone = AABox::create(Vector3D(2048.0f,100.0f,2048.0f));
   Ring* rainZone = Ring::create(Vector3D(0.0f,5.0f,0.0f));
   SphericEmitter* rainEmitter = SphericEmitter::create(Vector3D(0.0f,-1.0f,0.0f),0.0f,0.03f * PI);

   // drop emitter
   dropEmitter = SphericEmitter::create(Vector3D(0.0f,1.0f,0.0f),0.0f,0.2f * PI);

   // Groups
   // rain group
   Group* rainGroup = Group::create(rainModel,8000);
   //rainGroup->setCustomUpdate(&killRain); //not yet used

   // drop group
   Group* dropGroup = Group::create(dropModel,16000);

   // splash group
   Group* splashGroup = Group::create(splashModel,2400);

   // System
   particleSystem = SPK::IRR::IRRSystem::create(GetSmgr()->getRootSceneNode(), GetSmgr(), false);



And in the loop:
particleSystem->setTransformPosition(SPK::Vector3D(cam->getAbsolutePosition().X, cam->getAbsolutePosition().Y, cam->getAbsolutePosition().Z));
particleSystem->update((float)GetDriver()->getFPS() * 0.01);

As you see it´s almost the same code used in the example, just changed for using irrlicht-renderers and systems.

Do you have any clue what I´m doing wrong?


Back to top Go down
View user profile

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

PostSubject: Re: Implementing rain example with irrlicht   Wed Jan 25, 2012 8:30 am

Sorry for the late reply.

I ll check that (to see if I can reproduce the issue) and get back to you.
Back to top Go down
View user profile http://spark.developpez.com

Messages : 11
Date d'inscription : 2012-03-31

PostSubject: Re: Implementing rain example with irrlicht   Sat Apr 07, 2012 1:20 am

Question +1

I've also ported the Rain demo using Irrlicht as a renderer on my Android Phone.
Actually, I can see the effect, but the effect is not good(only some white line and splash effect can see)
I think the SPARK particle system is OK since i can see the rain effect.
Maybe the renderer part of Irrlicht-related has some problems.

PS, what i do is just 'COPY-PASTE' code from the related example.
Back to top Go down
View user profile
Sponsored content

PostSubject: Re: Implementing rain example with irrlicht   

Back to top Go down
Implementing rain example with irrlicht
Back to top 
Page 1 of 1

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