mmm...
i want to place a texture on a textured terrain...
like a circle to indicate what unit i have selected...
how can I?
i want to place a texture on a textured terrain...
like a circle to indicate what unit i have selected...
how can I?

;setup graphics Graphics3D 800, 600, 0, 2 SetBuffer BackBuffer() ;create 1st texture texture1 = CreateTexture(512, 512) Cls Color 0, 0, 255 For i = 0 To 512 Step 10 Line i, 0, i, 512 Line 0, i, 512, i Next CopyRect 0, 0, 512, 512, 0, 0, BackBuffer(), TextureBuffer(texture1) ;create 2nd texture Color 255, 255, 255 texture = CreateTexture(512, 512) Cls Oval 236, 236, 40, 40, 0 CopyRect 0, 0, 512, 512, 0, 0, BackBuffer(), TextureBuffer(texture) ScaleTexture texture, 4, 4 PositionTexture texture, 0.5, 0.5 ;create terrain tw = 512 ;terrainwidth terrain = CreateTerrain(tw) EntityTexture terrain, texture1 EntityTexture terrain, texture, 0, 1 TextureBlend texture, 3 ScaleTexture texture, tw, tw ;create camera camera = CreateCamera() ;CameraProjMode camera, 2 PositionEntity camera, tw/2, 500, tw/2 RotateEntity camera, 90, 0, 0 ;main loop Repeat ;calculate x/y position circle time = time + 1 x# = Cos(time) / 4 y# = Sin(time) / 4 ;position circle PositionTexture texture, x#, y# ;render RenderWorld() Flip ;until ESC is pressed Until KeyHit(1) End
;setup graphics Graphics3D 800, 600, 0, 2 SetBuffer BackBuffer() ;create 1st texture texture1 = CreateTexture(512, 512) Cls Color 0, 0, 255 For i = 0 To 512 Step 10 Line i, 0, i, 512 Line 0, i, 512, i Next CopyRect 0, 0, 512, 512, 0, 0, BackBuffer(), TextureBuffer(texture1) ;create terrain tw = 512 ;terrainwidth terrain = CreateTerrain(tw) EntityTexture terrain, texture1 ;create camera camera = CreateCamera() ;CameraProjMode camera, 2 PositionEntity camera, tw/2, 500, tw/2 RotateEntity camera, 90, 0, 0 ;create quad mesh = CreateMesh() surf = CreateSurface(mesh) AddVertex surf, -1, -1, 0, 0, 0 AddVertex surf, 1, -1, 0, 1, 0 AddVertex surf, 1, 1, 0, 1, 1 AddVertex surf, -1, 1, 0, 0, 1 AddTriangle surf, 0, 1, 2 AddTriangle surf, 0, 2, 3 RotateMesh mesh, 90, 0, 0 ScaleMesh mesh, 10, 1, 10 FlipMesh mesh ;main loop Repeat time = time + 1 PositionEntity mesh, Cos(time) * 100 + tw/2, 0, Sin(time) * 100 + tw/2 ;calculate x/y position circle For t = 0 To 3 TFormPoint VertexX(surf, t), VertexY(surf, t), VertexZ(surf, t), mesh, 0 yy# = TerrainY(terrain, TFormedX(), TFormedY(), TFormedZ()) TFormPoint TFormedX(), yy#, TFormedZ(), 0, mesh VertexCoords surf, t, TFormedX(), TFormedY(), TFormedZ() Next ;render RenderWorld() Flip ;until ESC is pressed Until KeyHit(1) End
;setup graphics Graphics3D 800, 600, 0, 2 SetBuffer BackBuffer() ;create 1st texture texture1 = CreateTexture(512, 512) Cls Color 0, 0, 255 For i = 0 To 512 Step 10 Line i, 0, i, 512 Line 0, i, 512, i Next CopyRect 0, 0, 512, 512, 0, 0, BackBuffer(), TextureBuffer(texture1) ScaleTexture texture1, 512, 512 ;create terrain tw = 512 ;terrainwidth terrain = CreateTerrain(tw);LoadTerrain("c:\_Xfiles\height44.bmp") ScaleEntity terrain, 1, 10, 1 EntityTexture terrain, texture1 ;create camera camera = CreateCamera() ;CameraProjMode camera, 2 PositionEntity camera, tw/2, 500, tw/2 RotateEntity camera, 90, 0, 0 ;create quad mesh = CreateMesh() surf = CreateSurface(mesh) AddVertex surf, -1, -1, 0, 0, 0 AddVertex surf, 1, -1, 0, 1, 0 AddVertex surf, 1, 1, 0, 1, 1 AddVertex surf, -1, 1, 0, 0, 1 AddTriangle surf, 0, 1, 2 AddTriangle surf, 0, 2, 3 RotateMesh mesh, 90, 0, 0 ;ScaleMesh mesh, 10, 1, 10 FlipMesh mesh camera2 = CreateCamera(mesh) MoveEntity camera2, 0, 20, -50 HideEntity camera ;main loop Repeat time = time + 1 PositionEntity mesh, Cos(time) * 100 + tw/2, 0, Sin(time) * 100 + tw/2 ;calculate x/y position circle For t = 0 To 3 TFormPoint VertexX(surf, t), VertexY(surf, t), VertexZ(surf, t), mesh, 0 yy# = TerrainY(terrain, TFormedX(), TFormedY(), TFormedZ()) + 1 TFormPoint TFormedX(), yy#, TFormedZ(), 0, mesh VertexCoords surf, t, TFormedX(), TFormedY(), TFormedZ() Next ;render RenderWorld() Flip ;until ESC is pressed Until KeyHit(1) End