Clipping objects

Blitz3D Forums/Blitz3D Programming/Clipping objects

Ash_UK(Posted 2005) [#1]
If i have an object that has seperate named parts, but is saved and exported (3ds) as a whole object.
Will Blitz3D still draw everything as a whole object all the time, or only the parts which the camera can see? (which is what i want)

So for example, i'm doing a racetrack but i don't want the whole track rendered all the time (only seperate parts when the camera can see them, obviously for speed purposes)

Thanks


jfk EO-11110(Posted 2005) [#2]
If you load it with LoadAnimMesh, it will render only the parts that are in front of the camera and within the camerarange.

I am not sure if it will occlude surfaces automaticly (when you load it with LoadMesh then the children or individually named parts are seperated and accessable as Surfaces, not children, compared to LoadAnimMesh)

You can easily test it, simply use "Print TrisRendered()" and let us know what it does.


Ash_UK(Posted 2005) [#3]
Hmmm, thanks very much jfk. I'll give that a try and let you know :)

Cheers


jfk EO-11110(Posted 2005) [#4]
Ehm, instead of

Print TrisRendered()

better use

Renderworld()
text 0,0, TrisRendered()

Print is not very useful unless you use Locate to prevent linefeeds.


jfk EO-11110(Posted 2005) [#5]
I just did a test myself too, it seems like:

LoadMesh will not clip anything that is part of the entity. Seperate Children inside the File will be handled as Surfaces that are part of the mesh entity, returned by the Command LoadMesh.

LoadAnimMesh will not clip anything as long as everything is one mesh. EG: a maplet exported Map that includes a number of surfaces will not be clipped because the surfaces are not children.

LoadAnimMesh WILL clip children that are part of the loaded mesh. So if you saved a scene with multiple entities (linked hierarchicly or not), they will show up as children of the main top parent entity returned by LoadAnimMesh and therefor they're gonna be clipped/occluded under the mentioned conditions.