I pinched a function from the code archives to help define a shape made with points. If I were to make another point (not part of the shape), how could I tell if it was inside or outside of the shape?
Graphics3D 640,480,0,2 SetBuffer BackBuffer() SeedRnd MilliSecs() HidePointer Global Camera = CreateCamera() Global Light = CreateLight() Global Plane = CreatePlane() Global PlaneTex = CreateTexture (64,64) Color 0,0,100 Rect 0,0,64,64 Color 0,0,150 Rect 0,0,32,32 Rect 32,32,32,32 CopyRect 0,0,64,64,0,0,BackBuffer(),TextureBuffer(PlaneTex) ScaleTexture PlaneTex,5,5 EntityTexture Plane,PlaneTex MoveEntity Plane,0,0,40 RotateEntity Plane,-90,0,0 EntityPickMode Plane,2 Type Cube Field X#,Y#,Z#,Mesh End Type Local CE.Cube,CE2.Cube While Not KeyDown (1) If MouseHit (1) CameraPick (Camera,MouseX(),MouseY()) CE.Cube = New Cube CE\Mesh = CreateCube() CE\X = PickedX() CE\Y = PickedY() CE\Z = PickedZ() PositionEntity CE\Mesh,CE\X,CE\Y,CE\Z EndIf UpdateWorld RenderWorld Color 0,255,0 For CE.Cube = Each Cube If CE = Last Cube CE2 = First Cube Else CE2 = After CE End If Color 0,255,0 ProjectLine (Camera,CE2,CE) Next Color 255,0,0 Line MouseX()-10,MouseY(),MouseX()+10,MouseY() Line MouseX(),MouseY()-10,MouseX(),MouseY()+10 Flip Wend End Function ProjectLine (Camera,CE.Cube,CE2.Cube) Local X1#,Y1#,X2#,Y2# CameraProject Camera,CE\X,CE\Y,CE\Z X1 = ProjectedX() Y1 = ProjectedY() CameraProject Camera,CE2\X,CE2\Y,CE2\Z X2 = ProjectedX() Y2 = ProjectedY() Line X1,Y1,X2,Y2 End Function