hi guys thanks for the responses.
i am using klepto's version and have been trying this code snippet...
Import sidesign.minib3d
Strict
Local width=640,height=480,depth=16,mode=0
Graphics3D width,height,depth,mode
Local cam:TCamera=CreateCamera()
CameraRange cam,.5,500
PositionEntity cam,0,10,-10
Local light:TLight=CreateLight(1)
RotateEntity light,90,0,0
Local mesh:TMesh=LoadMesh("test.b3d")
ScaleEntity mesh,10,10,10
' create mesh octree - makes collision detection faster (MiniB3D only)
CreateOctree(mesh,200,5)
' set camera entity type to 1
EntityType cam,1
' set camera radius as it's the source collision entity
EntityRadius cam,1
' set mesh entity type to 2
EntityType mesh,2
' use collisions command to enable colliisons between entity type 1 and 2, with reponse 4
Collisions 1,2,4,2
' used by camera code
Local mxs#=0
Local mys#=0
Local move#=0.5
MouseXSpeed() ' flush
MouseYSpeed() ' flush
' used by fps code
Local old_ms=MilliSecs()
Local renders
Local fps
While Not KeyDown(KEY_ESCAPE)
If KeyHit(KEY_ENTER) Then DebugStop
'' control camera
' mouse look
mxs#=mxs#+(MouseXSpeed()/5.0)
mys#=mys#+(MouseYSpeed()/5.0)
RotateEntity cam,mys#,-mxs#,0
MoveMouse width/2,height/2
MouseXSpeed() ' flush
MouseYSpeed() ' flush
' move camera forwards/backwards/left/right with cursor keys
If KeyDown(KEY_UP)=True Then MoveEntity cam,0,0,move# ' move camera forward
If KeyDown(KEY_DOWN)=True Then MoveEntity cam,0,0,-move# ' move camera back
If KeyDown(KEY_LEFT)=True Then MoveEntity cam,-move#,0,0 ' move camera left
If KeyDown(KEY_RIGHT)=True Then MoveEntity cam,move#,0,0 ' move camera right
''
UpdateWorld
RenderWorld
renders=renders+1
' calculate fps
If MilliSecs()-old_ms>=1000
old_ms=MilliSecs()
fps=renders
renders=0
EndIf
SetBlend AlphaBlend
DrawText "FPS: "+String(fps),0,0
SetAlpha 0.5
If KeyDown(Key_Space)
SetColor 255,0,0
DrawRect 30,30,300,300
EndIf
SetColor 255,255,255
Flip
Wend
End
but the whole object disappears unless i comment out between renderworld and flip
|