entity in view question

Blitz3D Forums/Blitz3D Programming/entity in view question

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

is there anyother way to find out if an entity can be seen by the camera. reason being it's a bit inaccurate. please run the following code to demonstrate. move the camera so the entity is out of view, it should still say entity in view becasue it only check the bounding box. This will be used to hide entities that are not in the cameras view.

Graphics3D 800,600
SetBuffer BackBuffer()

camera=CreateCamera()
PositionEntity camera,0,0,-10


light=CreateLight()


shape=CreateCylinder()
ScaleEntity shape,1,15,1
RotateEntity shape,0,0,45


While Not KeyHit(1)
	
	If KeyDown(203) Then MoveEntity camera,-0.2,0,0
	If KeyDown(205) Then MoveEntity camera,0.2,0,0
	If KeyDown(200) Then MoveEntity camera,0,0.2,0
	If KeyDown(208) Then MoveEntity camera,0,-0.2,0
	
	
	
	
	
	UpdateWorld
	RenderWorld
	If EntityInView(shape,camera) Then Text 0,0," i can see you!!!"
	Flip
Wend
End