3d z-buffer issue

Jon Hylands jon at huv.com
Sat Sep 21 14:04:48 UTC 2002


Hi everyone,

I'm working on adding a 3D view to my AUV simulator, so I've been playing
with the B3D stuff. I've got a model of an AUV read in to Squeak from Rhino
(using a raw triangle format and a parser I wrote). If I put this model
into one of the built in viewers, where you basically move the camera
around and the sub stays still, everything looks perfect all the time, so
I'm pretty sure I've got the normals computed correctly. 

I'm using an ambient light and two directional lights, and a surface
material, but no textures. The model is a B3DMultiMesh, composed of
B3DSimpleMesh pieces, which in turn are composed of B3DSimpleMeshFace and
then B3DSimpleMeshVertex objects. I computed the normals relative to the
faces, and then applied the normals to the verticies by sending
#assureVertexNormals to each B3DSimpleMeshFace. The AUV MultiMesh is
composed of nine simple meshes, which correspond to the different parts of
the sub:

Shell, RightFin, LeftFin, TopFin, BottomFin, LeftThrusterSupport,
RightThrusterSupport, LeftThruster, RightThruster

All the faces are triangles, so for instance the Shell mesh is composed of
48 triangular faces.

When I start moving the sub through space (using #translateBy:), and
keeping the camera stationary (tracking the sub), some strange things start
to happen.

I start getting what look like z-buffer artifacts, and I've attached a
couple JPGs that shows one of these. You can see it particularily near the
back of the sub, where the top fin is -- the bottom part of the fin sticks
down into the shell a bunch normally, but here it shows up in a ragged
manner, and the "hidden" parts you can see change with pretty much every
frame (as you can see if you compare the two images).

Has anyone seen this, or something like this? Any ideas?

Thanks,
Jon

--------------------------------------------------------------
   Jon Hylands      Jon at huv.com      http://www.huv.com/jon

  Project: Micro Seeker (Micro Autonomous Underwater Vehicle)
           http://www.huv.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Auv3dClipping.jpg
Type: image/jpeg
Size: 19102 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020921/2861e8aa/Auv3dClipping.jpg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Auv3dClipping2.jpg
Type: image/jpeg
Size: 18694 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020921/2861e8aa/Auv3dClipping2.jpg


More information about the Squeak-dev mailing list