Hiding Cameras?

Blitz3D Forums/Blitz3D Programming/Hiding Cameras?

Craig H. Nisbet(Posted 2004) [#1]
I thought you could show and hide cameras. I've written a system that uses that. It doesn't seem to work in my case. Can there only be one camera?


Craig H. Nisbet(Posted 2004) [#2]
Ok, I made a test that proves it works. I'll have to look over my code again.


N(Posted 2004) [#3]
There can be as many cameras as memory allows, and you can hide/show cameras. Hidden cameras won't render (as far as I can see).


BlackD(Posted 2004) [#4]
To hide a camera, either:
HideEntity camera
or
CameraProjMode camera,0

Both work. CameraProjMode is faster in a loop.

+BlackD


eizdealer(Posted 2004) [#5]
The manual says:
'0: no projection - disables camera (faster than HideEntity)'

Why is there 'HideEntity Camera' as well, if it does the same but is slower?


Mustang(Posted 2004) [#6]
Why is there 'HideEntity Camera' as well, if it does the same but is slower?


I think that "CameraProjMode" command came later... and it would be bad to chop off old commands because people might have written stuff that uses those... so compatibily?


BlackD(Posted 2004) [#7]
What Mustang said.. backwards compatiability.

Besides, I've written test routines doing loops of tens of thousands of HIDEENTITY/SHOWENTITY CAMERA and CAMERAPROJMODE CAMERA,0/1 and detect almost no speed difference at all.

Really, whichever suits you. I use CameraProjMode because you can feed the variables (ie, should it be on or off?) rather than hard coding them.

+BlackD


N(Posted 2004) [#8]
CAMERAPROJMODE CAMERA,0/1


Wouldn't that error out?

Edit: Or is it only n/0? My memory is really flaky at the moment due to stress (and getting a bit ticked off at the Managed DirectX documentation, but mostly stress).


Damien Sturdy(Posted 2004) [#9]
o.O he means
CameraProjmode Camera,value , Where Value can be either 0 or 1. (or 2?)... ie 0/1.. not 0 divided by 1 :P


N(Posted 2004) [#10]
Cygnus: I know that, I'm just half making fun of it and half being a twit. As usual.


BlackD(Posted 2004) [#11]
Hehe.. I read your first post up there, then your sig, and decided it would be cruel to answer. :)


_PJ_(Posted 2004) [#12]

Besides, I've written test routines doing loops of tens of thousands of HIDEENTITY/SHOWENTITY CAMERA and CAMERAPROJMODE CAMERA,0/1 and detect almost no speed difference at all.



Did these tests incorporate a 3d population comprising of many Tri's. As this is where the slowdown would occur I am sure. HideEntity would still render the view, but just not actually display the pixels on screen.


jfk EO-11110(Posted 2004) [#13]
there is also a further important diffrence between CameraProjMode and Hideentity Camera:

HideEntity makes the Collsions Handler "forget" the collision state, but CameraProjMode keeps the collision state intact. So your camera could easily break trough the ceil, only because you hide it temporarily, eg. to render a shadowmap using an other camera etc.


John Pickford(Posted 2004) [#14]
Hideentity will hide the children of the camera too.

I find the best way of working to to keep EVERYTHING hidden by default and show cameras\groups of entities only just before a render pass.

My current game has 5 or 6 render passes (calls to renderworld ) using this technique. It's fast and efficient.


jfk EO-11110(Posted 2004) [#15]
My camera has no children. But due to some problems I had with elipsoid EntityRadius (fall trough floor etc.), I am still using two Collision spheres for the player: one for the layer pivot and one for the camera/head. Depending on crouching state the distance between the two may differ. So when the player is inside a tight shaft and he releases the crouch key, the camera would break trough the ceil as soon as I hide it.