This is how I would do it - slightly different from your versions. Note that one issue you may have is using updatenormals on the cube as this command averages the normals of shared verts. In this case as the normals are the same for each vertice in the triangle it's probably quicker to just loop throught the triangles rather than the verts.
Stevie
;setup graphics Graphics3D 800, 600, 0, 2 SetBuffer BackBuffer() ;enable wireframe WireFrame 1 ;create camera camera = CreateCamera() MoveEntity camera, 0, 0, -5 ;create pivot for camera campiv = CreatePivot() EntityParent camera, campiv ;create cube cube = CreateCube() ;Omit this Line as UpdateNormals averages cooexistent vertices ;UpdateNormals cube s = GetSurface(cube, 1) Repeat ;turn camera TurnEntity campiv, 0, 1, 0 RenderWorld ;loop through all triangles For v = 0 To CountVertices( s ) - 1 ;get global vertex position TFormPoint VertexX( s, v ) , VertexY( s, v ), VertexZ( s, v ) , cube, 0 ;get direction vector from camera to vertex Cx# = TFormedX() - EntityX( camera, 1 ) Cy# = TFormedY() - EntityY( Camera, 1 ) Cz# = TFormedZ() - EntityZ( camera, 1 ) ;tform normal into Global coords TFormNormal VertexNX( s, v ) , VertexNY( s, v ) , VertexNZ( s, v ), cube, 0 ;dot product Dot# = Cx * TFormedX() + Cy * TFormedY() + Cz * TFormedZ() If Dot< 0 TFormPoint VertexX( s, v ) , VertexY( s, v) , VertexZ( s, v ), cube, 0 CameraProject camera, TFormedX(), TFormedY(), TFormedZ() Color 255,0,0 Oval ProjectedX()-1, ProjectedY()-1, 3, 3 End If Next Flip Until KeyHit(1) End
Stevie