Hi.
What my problem is that I want to chop images in 16 pieces, make a texture of it and put it on an entity.
1. Load in four images that will form my complete image.
2. Cut the big image into 16 pieces
3. These pieces need to be baked on a texture, and this
texture is placed on an entity
Unfortunately it seems all the images are the same, and do not represent the block it should be. Secondly, wouldn't there be a much more elegant way to position my entity relative to the camera position?
This is a mockup of what I am trying:

What my problem is that I want to chop images in 16 pieces, make a texture of it and put it on an entity.
1. Load in four images that will form my complete image.
2. Cut the big image into 16 pieces
3. These pieces need to be baked on a texture, and this
texture is placed on an entity
Unfortunately it seems all the images are the same, and do not represent the block it should be. Secondly, wouldn't there be a much more elegant way to position my entity relative to the camera position?
This is a mockup of what I am trying:

Graphics3D 640,480 SetBuffer BackBuffer() treasureMapSize = 474 pieceSize = treasureMapSize / 4 blockSize = treasureMapSize / 2 Type kaartstukje Field entity Field texture Field id End Type plane=CreatePlane() mycamera=CreateCamera() kaart1 = LoadSprite ("kaart1.jpg",4) kaart2 = LoadSprite ("kaart2.jpg",4) kaart3 = LoadSprite ("kaart3.jpg",4) kaart4 = LoadSprite ("kaart4.jpg",4) palen = LoadSprite ("vb.png",2) ScaleSprite palen,2,2 PositionEntity mycamera,1.7,2.7,0.97 RotateEntity mycamera,90,0,0 PositionEntity palen,1,0,1 PositionEntity kaart1,0,0,0 PositionEntity kaart2,2,0,0 PositionEntity kaart3,0,0,2 PositionEntity kaart4,2,0,2 RenderWorld Flip WaitKey ; this loop SHOULD do the following: ; chop the area from 0,0 to pieceSize,pieceSize in 16 tiles, ; place each tile (image) onto a texture, and place the texture on an entity (Sprite) For y = 0 To 3 For x = 0 To 3 k.kaartstukje = New kaartstukje k\entity = CreateSprite() image = CreateImage(pieceSize,pieceSize) CopyRect pieceSize*x,pieceSize*y,pieceSize ,pieceSize ,0,0,BackBuffer(),ImageBuffer(image) k\texture = CreateTexture(pieceSize,pieceSize) SetBuffer TextureBuffer(k\texture) DrawImage image,0,0 SetBuffer BackBuffer() EntityTexture k\entity,k\texture FreeImage image Next Next ; free the entities I don't need anymore FreeEntity kaart1 FreeEntity kaart2 FreeEntity kaart3 FreeEntity kaart4 FreeEntity palen For k.kaartstukje = Each kaartstukje PositionEntity k\entity,0,0,0 RenderWorld Flip Delay(400) Next While Not KeyHit(1) RenderWorld Text 0,0,MouseX() Text 0,20,MouseY() Flip Wend End