Mask texture problem

Archives Forums/Blitz3D SDK Programming/Mask texture problem

KronosUK(Posted 2013) [#1]
Could someone with Blitz3dsdk please test this program and let me know if they experience the following.

For some reason the masking doesn't work for me when

a) the plane is invisible
b) the plane is visible and the camera is below 0 on the Y axis


Import blitz3d.blitz3dsdk



bbBeginBlitz3D()

bbGraphics3D(1024, 768)

SeedRnd MilliSecs()

camera = bbCreateCamera()
bbCameraClsColor Camera, 150, 150, 250
bbPositionEntity(Camera, 0, 0, 0, 1)


plane= bbCreatePlane()'
bbEntityColor plane,0,200,0
bbMoveEntity plane,0,1,0

bbAmbientLight 200, 200, 200
Light = bbCreateLight()
bbMoveEntity Light, 100, 100, 100

tex = bbLoadTexture("media\maps\singlemountains01_terraintex.png",1+4)'insert your mask texture here.



	cube=bbCreateCube()
	bbScaleEntity cube,10,10,10
	bbEntityTexture cube,tex

Local toggle=1


While Not bbKeyHit(BBKEY_ESCAPE) And Not AppTerminate()
	
	If bbKeyDown(bbkey_UP) Then bbMoveEntity camera,0,0,1
	If bbKeyDown(bbkey_Down) Then bbMoveEntity camera,0,0,-1
	If bbKeyDown(bbkey_left) Then bbTurnEntity camera,0,1,0
	If bbKeyDown(bbkey_right) Then bbTurnEntity camera,0,-1,0
	If bbKeyDown(bbkey_space) Then bbMoveEntity camera,0,1,0
	If bbKeyDown(bbkey_leftshift) Then bbMoveEntity camera,0,-1,0

		
	If bbKeyHit(bbKey_O) Then toggle=-toggle
	If toggle = -1 Then bbHideEntity plane Else bbShowEntity plane
	

	bbUpdateWorld()
	bbRenderWorld()
	

	
	bbFlip()
Wend

bbShowPointer()




KronosUK(Posted 2014) [#2]
Must be an error in either my texture or programming because I wrote a similar thing from scratch for a different test and it worked fine!