LotusParticleSystem R1
Blitz3D Forums/Blitz3D Beginners Area/LotusParticleSystem R1
| ||
Ok I gave up with RootParticles(see the post) And now I'm working with Lotus. Hoping someone use it, I 'm here to ask help. I'm tring to draw 5-6 fires, but I don't know If it is the right way... here it is (the code):
;use the arrow keys to move
;refer to Example.lps for the emitter settings
Graphics3D 800,600,32,2
SetBuffer BackBuffer()
Include "h_lotus.bb"
InitLotus()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Using a type to draw some fires
Type fire
Field x#
Field y#
Field z#
Field flame#
End Type
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
C = CreateCamera()
PositionEntity C,-10,10,-10
CameraClsColor C,32,32,32
CameraClsMode C,1,1
CameraRange C,.01,10000
SetLotusCamera C
;; FPS
MFPS = 45
Period = 1000/MFPS
Time = MilliSecs()-Period
Global fps,timenext,frames
;; LIGHT
L = CreateLight(2)
PositionEntity L,24,24,24
LightRange L,Sqr(64*64*3)/4
LightColor L,255,255,255
AmbientLight 128,128,128
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Here I create 6 fires... Is the right way???
For a = 0 To 5
fire1.fire = New fire
fire1\flame = LoadASCIIEmitters("Example.lps")
fire1\x = Rand(0,50)
fire1\y = Rand(0,50)
fire1\z = Rand(0,50)
Next
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
S = CreateSphere(32)
ScaleMesh S,32,32,32
FlipMesh S
UpdateNormals S
EntityColor S,128,128,1
EntityShininess S,.05
T = LoadTexture("media/diffuse4.bmp")
ScaleTexture T,.25,.25
EntityTexture S,T,0,0
Repeat
Repeat
Elapsed = MilliSecs() - time
Until Elapsed
Ticks=Elapsed/Period
Tween#=Float(Elapsed Mod Period) / Float(Period)
If KeyDown(57) Then WireFrame 1 Else WireFrame 0
For U = 0 To Ticks
Time = Time + Period
;; UPDATE CAMERA
mxs# = mxs + Float(MouseXSpeed())/3
mys# = mys + Float(MouseYSpeed())/3
mxs = mxs - mxs/4
mys = mys - mys/4
TurnEntity C,mys,-mxs,0
RotateEntity C,Min(Max(EntityPitch(C),80),-80),EntityYaw(C),0
MoveEntity C,(KeyDown(205)-KeyDown(203))*.2,0,(KeyDown(200)-KeyDown(208))*.2
MoveMouse GraphicsWidth()/2,GraphicsHeight()/2
;; UPDATE PARTICLES
UpdateLotusParticles()
UpdateWorld
If U = Ticks Then CaptureWorld
Next
RenderWorld Tween
Text 2,2,"FPS: "+GetFPS(False)
Text 2,22,"Particles: "+gLotusParticleCount
Flip False
Until KeyHit(1)
KillLotus()
Function GetFPS(JustChecking = False)
If Not JustChecking Then frames = frames+1
If MilliSecs() > timenext Then
timenext = MilliSecs()+1000
fps = frames
frames = 0
EndIf
Return fps
End Function
And It doesn't works... Why??? What I have to do??? |
| ||
| at a guess: " fire1\flame = LoadASCIIEmitters("Example.lps") " You are attempting to LOAD this file 5 times and then set the values in a type... I need to reread the docs... I haven't played with this in such a long time... where is Filax? He would know... Filax knows everything! |