How to clear the 3d environment and start another

Blitz3D Forums/Blitz3D Beginners Area/How to clear the 3d environment and start another

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

1. blitz handles drawing of entities, anything out of view is not drawn, anything out of camera range is not drawn etc
2.You canhave types which hold your 3d data eg

type TCar
field name$, id$ etc
field mesh.TEntity
end type

type TEntity
field ent
field scaleX,scaleY,scaleZ etc
end type

then do a simple

for ThisCar.TCar = each TCar
if not ThisCar\mesh = null
if ThisCar\mesh\ent
freeentity ThisCar\mesh\ent
endif

delete ThisCar\mesh

endif
next

This allows simple management of large amounts of objects.

3. You could have base entities and then copy them to the meshpointer

eg

type TBaseEntity
field name$
field mesh%
end type

function Copy_BaseEntity(name$)
for ThisBase.TBaseEntity = each TBaseEntity
if ThisBase\name = name
return copyentity(ThisBase\mesh)
endif
next
end function

You would create the base entities on startup of a map\level and then copy as needed.