Coolzero
21-03-2010 08:35:53
Hi,
i work with VB 2008 Express and Mogre v1.4.8, so far so good.
Now i want to insert particle effects like smoke, but won't use script files (*.particle)
I'm using following code to create the particlesystem and the emitter:
But the emitted particles need a texture too , and here is my problem. I know to add a texture i must use the affector ColourImage.
But how can i set the texture . ps.GetAffector(CUShort(0)).SetParameter("image", "smoke.png") doesn't seems to be working here.
Can some one help me please ?
thx
i work with VB 2008 Express and Mogre v1.4.8, so far so good.
Now i want to insert particle effects like smoke, but won't use script files (*.particle)
I'm using following code to create the particlesystem and the emitter:
Shared Function Smoke1(ByVal scene As Mogre.SceneManager) As Boolean
Dim ps As New Mogre.ParticleSystem()
ps.ParticleQuota = 500 'Maximale Anzahl an Partikeln die erzeugt werden
ps.Visible = True
ps.DefaultWidth = 5
ps.DefaultHeight = 5
'Emitter dem PartikelSystem hinzufügen
ps.AddEmitter("Point")
'Emitter Eigenschaften festlegen
With ps.GetEmitter(CUShort(0))
.Name = "SmokeEmitter"
.SetColour(Mogre.ColourValue.Blue, Mogre.ColourValue.Red)
.ParticleVelocity = 5
.Direction = New Mogre.Vector3(0, 1, 0)
.Position = New Mogre.Vector3(-2, 32, 2)
.MinParticleVelocity = 6 'minimal Geschwindigkeit der Partikel
.MaxParticleVelocity = 8 'maximal Geschwindigkeit der Partikel
.Angle = 0.25 'maximaler Winkel in dem die Partikel ausgesendet werden
.TimeToLive = 4 'Lebenszeit eines Partikels in Sekunden
End With
ps.AddAffector("ColourImage")
ps.GetAffector(CUShort(0)).SetParameter("image", "smoke.png")
'das ParticleSystem der Szene zuweisen
scene.RootSceneNode.CreateChildSceneNode().AttachObject(ps)
Return True
End Function
But the emitted particles need a texture too , and here is my problem. I know to add a texture i must use the affector ColourImage.
But how can i set the texture . ps.GetAffector(CUShort(0)).SetParameter("image", "smoke.png") doesn't seems to be working here.
Can some one help me please ?
thx