3D Object as a part of HUD Help

Blitz3D Forums/Blitz3D Programming/3D Object as a part of HUD Help

Naughty Alien(Posted 2007) [#1]
..I would like to make sphere as a part of my HUD for game I'm working on..unfortunatelly I didnt find a way how to successfuly integrate this 3D object on to my camera scene for every given resolution as well as automatic initial camera position setting, no matter where is it (random start)..any ideas guys??


Uncle(Posted 2007) [#2]
Im not sure how blitz handles non 4:3 ration screen sizes, but it it just stretches the screen then the below should work I think will all resolutions?

Graphics3D 800,600,0,2
HidePointer

camera=CreateCamera()
sphere=CreateSphere(10,camera)
MoveEntity sphere,0,-3,4

;fill the screen with some random blocks
For x=1 To 40
	temp=CreateCube()
	EntityColor temp,Rand(255),Rand(255),Rand(255)
	PositionEntity temp,Rand(-30,30),Rand(-30,30),Rand(-30,30)
Next

While Not KeyDown(1)
	;mouse look
	TurnEntity camera,MouseYSpeed(),-MouseXSpeed(),0
	RotateEntity camera,EntityPitch(camera), EntityYaw(camera),0
	MoveMouse GraphicsWidth()/2,GraphicsHeight()/2
	
	
	RenderWorld
	Flip
Wend


Cheers,


Unc


Stevie G(Posted 2007) [#3]
Just use a second HUD camera, positioned well away from the main scene and use cameracls, with color true and z-buffer false ( IIRC ). Also, set the entityorder of the camera to be rendered last.

If you position the sphere relative to this new camera then the resolution is irrelevant providing it's always the same aspect ratio.

Stevie