tricks of the professionals

Blitz3D Forums/Blitz3D Programming/tricks of the professionals

ok, just as a side issue, why can't I LOD a mesh? you can do it for terrain, why not Meshes? Aren't terrains just a mesh?

I've just seen Rob's code but that loads 3 seperate entites of varing detail, it's not automatic like terrain.

Maybe I could construct a low-low-low detail hoplite for far away shots .... hmmmmm ... interesting.

As with surfaces, I must be really dumb, I still don't get it! I know a surface as a triangle of 3 vertices and 1 face? so Milkshape states?

Here's my entity initialization code .. might help?


For x=1 To 60
phalanx2.warrior=CreateWarrior2(x,tx2#,tz2#)
Next

...

Function CreateWarrior2.warrior( Numb,x#,z# )

If Numb = FIRST_ELEM ; if first, load mesh

warrior_object=LoadAnimMesh( "UltraThinHop.b3d" )
hop_texture=LoadTexture( "samtxt.bmp", 4 ) ; 4 = Black for transparent

hopwalk1=ExtractAnimSeq( warrior_object, 1, 30 )
; Hoplite - shield side, spear angled forward
hopwalk2=ExtractAnimSeq( warrior_object, 31, 60 )
; Hoplite - shield front, spear angled forward
hopwalk3=ExtractAnimSeq( warrior_object, 61, 90 )
; Hoplite - shield front, spear leveled
hopwalk4=ExtractAnimSeq( warrior_object, 91, 120 )

ScaleEntity warrior_object,.020,.020,.020
TranslateEntity warrior_object,0,-1.25,0
RotateEntity warrior_object, 90,0,0
EntityTexture warrior_object, hop_texture

HideEntity warrior_object

; To allow mouse click to select object on battlefield
EntityPickMode warrior_object, 3

End If
; then create warrior, copy entity
p.warrior=New warrior
p\entity=CopyEntity( warrior_object )
NameEntity p\entity, "Objects"
p\entity_Type = 1 ; object
p\height_offset = 20

...

PosWarrior( p )

Return p
End Function

...

loop ; includes tweening etc not shown
getkeys()
movesoldiers() ; MoveEntity
end loop