HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log inLog in  

Share | 
 

 Leaves emitter with irrlicht

View previous topic View next topic Go down 
AuthorMessage
DemoneRosso



Messages : 1
Date d'inscription : 2010-12-20

PostSubject: Leaves emitter with irrlicht   Mon Dec 20, 2010 8:07 am

Hi i need some help for creating a leaves emitter.

I have a heightfield and a
float getHeight(float x, float y)
method
wich gets the interpolated height of a terrain

as particles i will use a sprite set : a unique texture file wich have different leaves types (green leaves, yellow leaves, leaves of different shapes ecc).


what i need is to create an emitter and a animator wich can handle multiple leavese falling down around the player.
every leaves uses 32x32 and 16x16 portions of the sprite set (usually a 512x512 with 30-32 differente leaves).

so i have to set the initial position of a leave

initialHeight=getHeight(x,y)+tree height

and make them falling down until they reach the end of the terrain

finalHeight =getHeight(x,y)-epsilon

the most difficult part is animate leaves. i have no idea of what kind of function can reach a realistic falling down. I have tried with a spline but it is not clockwise with many leaves (up to 64 gives a realistic result, but this were done without a particle engine.)

I want to do that with irrlicht rendering plugin.
The project i'm working will be released opensource and much thanks to anyone can help me in a significative manner.

Another difficult point is how to use different UV sets using sparkirr for make possible render different leaves types using only 1 material.
Back to top Go down
View user profile
Juff
Developer


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

PostSubject: Re: Leaves emitter with irrlicht   Mon Dec 20, 2010 5:38 pm

Hi, I have moved the topic to "questions"

Regarding the use of "sprite set", you can do it with spark by using texture index parameter and IRRQuadRenderer::setAtlasDimensions. There are some examples in the demos using those (the fire demo for instance).

About the movement of falling leaves, you ll have to try and test. A modifier with a random force evolving per particle and a high friction should do it. There s a modifier in SPARK 2 called the random modifier. However SPARK 2 is not fully finished yet. But you can code your own modifier for SPARK 1 based on the random modifier. In this modifier you can also include a test to kill particles when they hit the ground and use immortal particles (with no defined life span).

So I suggest you try to get a nive behaviour by trying and testing in a custom modifier.

If you have some questions, dont hesitate.
Back to top Go down
View user profile http://spark.developpez.com
 
Leaves emitter with irrlicht
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» ze_chaofan Leaves Staff
» Autumn Leaves Ranks

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