Cubemapping bug, or ChrML bug?

Blitz3D Forums/Blitz3D Programming/Cubemapping bug, or ChrML bug?



This looks exactly like it looks in 3dsmax when the UV's are wrong. You see the error happens in the triangle seperator. How can I fix that? Here's my code:

debugmap = HM_GetModel("mirror1")
	
cubex=512
cubey=512
	
debugcam = CreateCamera()
debugtex = CreateTexture(cubex,cubey,128+256+1)
	
HideEntity debugmap
PositionEntity debugcam,EntityX(debugmap),EntityY(debugmap),EntityZ(debugmap)
CameraViewport(debugcam,0,0,cubex,cubey)
EntityTexture debugmap,debugtex
	
;0
SetCubeFace debugtex,0
RotateEntity debugcam,0,90,0
RenderWorld
CopyRect 0,0,cubex,cubey,0,0,BackBuffer(),TextureBuffer(debugtex)
	
;1
SetCubeFace debugtex,1
RotateEntity debugcam,0,0,0
RenderWorld
CopyRect 0,0,cubex,cubey,0,0,BackBuffer(),TextureBuffer(debugtex)
	
;2
SetCubeFace debugtex,2
RotateEntity debugcam,0,-90,0
RenderWorld
CopyRect 0,0,cubex,cubey,0,0,BackBuffer(),TextureBuffer(debugtex)
	
;3
SetCubeFace debugtex,3
RotateEntity debugcam,0,180,0
RenderWorld
CopyRect 0,0,cubex,cubey,0,0,BackBuffer(),TextureBuffer(debugtex)
	
;4
SetCubeFace debugtex,4
RotateEntity debugcam,-90,0,0
RenderWorld
CopyRect 0,0,cubex,cubey,0,0,BackBuffer(),TextureBuffer(debugtex)
	
;5
SetCubeFace debugtex,5
RotateEntity debugcam,90,0,0
RenderWorld
CopyRect 0,0,cubex,cubey,0,0,BackBuffer(),TextureBuffer(debugtex)
	
	  
ShowEntity debugmap
FreeEntity debugcam
FreeTexture debugtex


This happens each mainloop. Don't worry about that I create the camera and the texture and free them each time, because this is only a test. HM_GetModel is my function and returns the model named 'mirror1' (the cube in the screenshot). What can be wrong?