Preventing Automatic Culling

Blitz3D Forums/Blitz3D Beginners Area/Preventing Automatic Culling

ardee(Posted 2008) [#1]
So... I have written this very nice 3rd person camera routine which has a master pivot with entity radius for collision. Parented to this master are various other pivots, camera and an animated .b3d mesh for the "player" model.

With Blitz, anything not in render view is automatically removed which works fine except that sometimes the master pivot goes briefly out of view of the camera and consequently everything parented to it disappears as well. This causes the player model to briefly disappaear and then pop into view. Not very nice. Is there an easy way to tell Blitz not to cull the master pivot even if it is briefly out of view so that it's child player model stops this behaviour?


Stevie G(Posted 2008) [#2]
There was some culling command introduced in v.1.99 IIRC - not sure if this is any use.

Personally, I would detach your children from the master pivot and position them globally.

if you need to offset them from the master pivot taking into consideration he master pivots rotation use tformpoint. Assuming the player is positioned 10 units above and 10 units behind the Master Pivot in local space ...

tformpoint 0,10,-10, MasterPivot, 0
positionentity player, tformedx(), tformedy(), tformedz()


Stevie


Beaker(Posted 2008) [#3]
Use MeshCullBox. From versions.txt:
"Added MeshCullBox for manual mesh culling. This allows you to correct some situations where an animated mesh extends beyond the guesstimated bounding box."


ardee(Posted 2008) [#4]
That sounds exactly what I need, thanks for the help. And thanks to marckcw for documenting the new features which I only discovered by searching the forum for MeshCullBox.

For those that missed the docs upgrade for v1.99 see here...
http://www.blitzbasic.com/Community/posts.php?topic=77065#862348


ardee(Posted 2008) [#5]
Sweet Blitz3D goodness it works perfectly, I now have a very smooth 3rd person camera with collisions and obstruction avoidance. Thanks again.