model shows when debug is on and doesnt when off

Blitz3D Forums/Blitz3D Programming/model shows when debug is on and doesnt when off

GameCoder(Posted 2004) [#1]
WHat could be causing this. I have never done 3d so this is my first attempt. The code is simple.

Graphics3D 800,600


light = CreateLight()
camera = CreateCamera()

cube = LoadMesh("cube.3ds")


While Not KeyHit(1)
	UpdateWorld
	
	PositionEntity cube,0,0,200

	RenderWorld
	
	
Wend


When debug is on I can see the little cube I made. When debug is off and i go to full screen I cant see anything :/


DougUK(Posted 2004) [#2]
you havn't told the camera were to be positioned.
try PositionEntity camera,0,0,EntityZ(cube)-n
where n=distance of camera from cube.

also you need to add flip after renderworld

regards


GameCoder(Posted 2004) [#3]
Nope, I'm still getting the same problem. It shows perfactly with your modification in debug mode but not when debug is off. :/


GfK(Posted 2004) [#4]
This works. I think you missed what DAGJ said about "flip"? Also, you don't need to do PositionEntity every loop, and you only need UpdateWorld() if you're doing collisions or animation.
Graphics3D 800,600

light = CreateLight()
camera = CreateCamera()

cube = CreateCube()
PositionEntity cube,0,0,200

While Not KeyHit(1)
	;UpdateWorld
	RenderWorld
	Flip
	
Wend



DougUK(Posted 2004) [#5]
Graphics3D 800,600


light = CreateLight()
camera = CreateCamera()
cube = CreateCube()
PositionEntity camera,0,3,EntityZ(cube)-10


While Not KeyHit(1)


PositionEntity cube,0,0,0

UpdateWorld
RenderWorld

Flip
Wend


DougUK(Posted 2004) [#6]
GFK beat me lol


GameCoder(Posted 2004) [#7]
That method works also but only in debug mode. All the methods posted here work in debug mode but not when debug mode is off.


DougUK(Posted 2004) [#8]
should work also when debug is off, weird


GfK(Posted 2004) [#9]
Try forcing 16 or 32-bit colour. Full screen mode default colour depth probably isn't the same as your desktop.


GameCoder(Posted 2004) [#10]
ahh thx GFK. When I add 16 or 32 in Graphics3d 800,600 it works fine.

What bit depth does it use by default if you dont specify 16 or 32? O_o


GfK(Posted 2004) [#11]
Varies. Depends on the hardware. Don't rely on it choosing one or the other. You can find out for your own system thus:
Graphics3D 800,600,0,1
Text 0,0,GraphicsDepth()
Flip
WaitKey
End



_PJ_(Posted 2004) [#12]
no buffer aset either (although I undertsand 3D only renders to backbuffer)


GfK(Posted 2004) [#13]
no buffer aset either (although I undertsand 3D only renders to backbuffer)
Yes it does, which is why I didn't bother to set it manually. ;)


Shambler(Posted 2004) [#14]
@Amon I am interested to know what bitdepth is displayed when you run Gfk's little code snippet.