b3d bone animation
b3d bone animation
Blitz3D Forums/Blitz3D Programming/b3d bone animation Someone hlep me?
i saw animate in unwrap3d.
but white cylinder is not animate in blitz3d.
i don't know. because this is firsttime animate b3d fromat. so..
and i'm looking for toon shading code.
code
------------------
Graphics3D 640,480
Global textrue_scroll_x_cnt#
SetBuffer BackBuffer()
camera=CreateCamera()
light=CreateLight()
RotateEntity light,90,0,0
SetBuffer BackBuffer()
cam=CreateCamera()
AmbientLight 255,255,255
MoveEntity cam,0,0,-10
light=CreateLight()
RotateEntity light,90,0,0
; Load mesh
drum=LoadAnimMesh ("wait.b3d")
LoadAnimSeq ( drum,"wait.b3d" )
;PositionEntity drum,0,0,3;MeshDepth(drum)*2
Animate drum,1,0.1;,30,40
FlushKeys
msp#=2
While Not KeyHit(1); Or out_check=True
; Cls
;lPointEntity cam,drum
CameraClsColor camera,255,0,0
If MouseHit(15) Then out_check=True
If KeyDown (42)
;front
If KeyDown(17) MoveEntity cam,0,0,msp#*0.1
If KeyDown(31) MoveEntity cam,0,0,-msp#*0.1
If KeyDown(30) MoveEntity cam,-msp#*0.1,0,0;side step right
If KeyDown(32) MoveEntity cam,msp#*0.1,0,0;side step left
Else
;front
If KeyDown(17) MoveEntity cam,0,0,msp#
If KeyDown(31) MoveEntity cam,0,0,-msp#
If KeyDown(30) MoveEntity cam,-msp#,0,0;side step right
If KeyDown(32) MoveEntity cam,msp#,0,0;side step left
EndIf
mMX# = MouseXSpeed() * 0.650
mMY# = MouseYSpeed() * 0.650
If MouseDown(1) Then MoveEntity cam,0,msp#,0;side step left
If MouseDown(2) Then MoveEntity cam,0,-msp#,0;side step left
MoveMouse(640/2,480/2)
TurnEntity(cam,mMY#,0,0,False)
TurnEntity(cam,0,-mMX#,0,True)
UpdateWorld
RenderWorld
Color 255,255,0
Text 10,100,"cam:"+cam_range
Text 10,120,"camx:"+EntityX#(cam)
Text 10,140,"camy:"+EntityY#(cam)
Text 10,160,"camz:"+EntityZ#(cam)
Text 10,180,"Roll: "+Int(EntityRoll#(cam))
Text 10,200,"yaw: "+Int(EntityYaw#(cam))
Text 10,220,"pitch: "+Int(EntityPitch#(cam))
Text 10,240,"cam show flag:"+show_mult_cam_flag
Text 10,250,"ani time"+AnimTime(drum)
Text 10,260,"Triangles Rendered: "+TrisRendered()
Flip
Wend
FlushMouse
FlushKeys
i saw animate in unwrap3d.
but white cylinder is not animate in blitz3d.
i don't know. because this is firsttime animate b3d fromat. so..
and i'm looking for toon shading code.
code
------------------
Graphics3D 640,480
Global textrue_scroll_x_cnt#
SetBuffer BackBuffer()
camera=CreateCamera()
light=CreateLight()
RotateEntity light,90,0,0
SetBuffer BackBuffer()
cam=CreateCamera()
AmbientLight 255,255,255
MoveEntity cam,0,0,-10
light=CreateLight()
RotateEntity light,90,0,0
; Load mesh
drum=LoadAnimMesh ("wait.b3d")
LoadAnimSeq ( drum,"wait.b3d" )
;PositionEntity drum,0,0,3;MeshDepth(drum)*2
Animate drum,1,0.1;,30,40
FlushKeys
msp#=2
While Not KeyHit(1); Or out_check=True
; Cls
;lPointEntity cam,drum
CameraClsColor camera,255,0,0
If MouseHit(15) Then out_check=True
If KeyDown (42)
;front
If KeyDown(17) MoveEntity cam,0,0,msp#*0.1
If KeyDown(31) MoveEntity cam,0,0,-msp#*0.1
If KeyDown(30) MoveEntity cam,-msp#*0.1,0,0;side step right
If KeyDown(32) MoveEntity cam,msp#*0.1,0,0;side step left
Else
;front
If KeyDown(17) MoveEntity cam,0,0,msp#
If KeyDown(31) MoveEntity cam,0,0,-msp#
If KeyDown(30) MoveEntity cam,-msp#,0,0;side step right
If KeyDown(32) MoveEntity cam,msp#,0,0;side step left
EndIf
mMX# = MouseXSpeed() * 0.650
mMY# = MouseYSpeed() * 0.650
If MouseDown(1) Then MoveEntity cam,0,msp#,0;side step left
If MouseDown(2) Then MoveEntity cam,0,-msp#,0;side step left
MoveMouse(640/2,480/2)
TurnEntity(cam,mMY#,0,0,False)
TurnEntity(cam,0,-mMX#,0,True)
UpdateWorld
RenderWorld
Color 255,255,0
Text 10,100,"cam:"+cam_range
Text 10,120,"camx:"+EntityX#(cam)
Text 10,140,"camy:"+EntityY#(cam)
Text 10,160,"camz:"+EntityZ#(cam)
Text 10,180,"Roll: "+Int(EntityRoll#(cam))
Text 10,200,"yaw: "+Int(EntityYaw#(cam))
Text 10,220,"pitch: "+Int(EntityPitch#(cam))
Text 10,240,"cam show flag:"+show_mult_cam_flag
Text 10,250,"ani time"+AnimTime(drum)
Text 10,260,"Triangles Rendered: "+TrisRendered()
Flip
Wend
FlushMouse
FlushKeys
I think there are a few toon shading examples in the code archives.
Well your model - I don't know exactly what you're doing wrong, if it's something with the model or in your code, although the code looks pretty good. there's only one thing: Try this:
Skip the line :
LoadAnimSeq ( drum,"wait.b3d" )
LoadAnimSeq is used to ADD the animation of a file to an already existing animated Mesh. It is not useful to add the same Animation to "drum" that is already loaded.
Also try to use a plain:
Animate drum
...for a first test. If it still don't works then something may be wrong with the model.
Well your model - I don't know exactly what you're doing wrong, if it's something with the model or in your code, although the code looks pretty good. there's only one thing: Try this:
Skip the line :
LoadAnimSeq ( drum,"wait.b3d" )
LoadAnimSeq is used to ADD the animation of a file to an already existing animated Mesh. It is not useful to add the same Animation to "drum" that is already loaded.
Also try to use a plain:
Animate drum
...for a first test. If it still don't works then something may be wrong with the model.