I've tried to identify the top and bottom of a car after it has been created and apply some number code in something like the following manner. I've referred to the JV-ODE wiki and have not had much joy. Can anyone shed any light on how I would identify the top & bottom of a car once created in JV-ODE and apply images to the top & bottom?
Graphics3D 800, 600, 0, 2 SetBuffer BackBuffer() ;create texture that contains numbers SetFont LoadFont("Arial", 20, 1) tex = CreateTexture(16, 16, 1+8, 10) For i = 0 To 9 Color 255, 0, 0 Rect 0, 0, 16, 16 Color 255, 255, 0 Text 8, 8, i, 1, 1 CopyRect 0, 0, 16, 16, 0, 0, BackBuffer(), TextureBuffer(tex, i) Next ;create new mesh mesh = CreateMesh() ;create surface 1 surf1 = CreateSurface(mesh) ;create 4 vertices v0 = AddVertex(surf1, 0, 1, 0, 1.0, 0.0) v1 = AddVertex(surf1, 0, -1, 0, 1.0, 1.0) v2 = AddVertex(surf1, -1, -1, 0, 0.0, 1.0) v3 = AddVertex(surf1, -1, 1, 0, 0.0, 0.0) ;create 2 triangles AddTriangle surf1, v0, v1, v2 AddTriangle surf1, v2, v3, v0 ;create surface 2 surf2 = CreateSurface(mesh) ;create 4 vertices v0 = AddVertex(surf2, 1, 1, 0, 1.0, 0.0) v1 = AddVertex(surf2, 1, -1, 0, 1.0, 1.0) v2 = AddVertex(surf2, 0, -1, 0, 0.0, 1.0) v3 = AddVertex(surf2, 0, 1, 0, 0.0, 0.0) ;create 2 triangles AddTriangle surf2, v0, v1, v2 AddTriangle surf2, v2, v3, v0 ;create brush, used for painting on the mesh brush = CreateBrush() ;create camera cam = CreateCamera() MoveEntity cam, 0, 0, -5 ;used for delaying counter nxt = MilliSecs() ;main loop Repeat ;w = wireframe WireFrame KeyDown(17) ;turn mesh ;TurnEntity mesh, 1, 2, 3 ;counter that puts number's digits into 'c1' and 'c2' If MilliSecs() > nxt Then nxt = nxt + 250 cc = cc + 1 c1 = (cc / 10) Mod 10 c2 = cc Mod 10 End If ;----update texture----- ;select texture for brush BrushTexture brush, tex, c1 ;assign brush to surface 1 PaintSurface surf1, brush ;select texture for brush BrushTexture brush, tex, c2 ;assign brush to surface 2 PaintSurface surf2, brush ;render world RenderWorld Flip ;esc = exit Until KeyHit(1) End
