Camera range and animated models.

Blitz3D Forums/Blitz3D Programming/Camera range and animated models.

wmaass(Posted 2009) [#1]
I have this animated gun in a hand that I want close enough to the camera so that you don't see the chopped off arms but if I put the camera too close the model, it disappears. I tried messing with camera range to keep it in view to no avail. If I don't animate it I can get as close as I want. Any idea?


Matty(Posted 2009) [#2]
Have you tried messing around with 'entityorder' on the 'gun' so that it appears on top of everything?


wmaass(Posted 2009) [#3]
Just tried it no luck. I'll keep fussing with it. Is there a good FPS example around here that shows the general idea?


MadJack(Posted 2009) [#4]
From memory, using entityorder on complex meshes can cause polygon sorting/rendering glitches.

A better method might be to render your gun after rendering your level geometry i.e. one camera for your level geometry, a second camera to render your gun.

Another option is to scale down your gun, but bring it close to the camera - so that it appears at the correct scale, but the model is small and contained within your character's collision radius.

Another option which I have seen but which is less common, is to check if your gun is/about to clip with level geometry and have it 'lowered'.


stayne(Posted 2009) [#5]
You tried a near camera range of 0.1? Just checking.


wmaass(Posted 2009) [#6]
Yep, tried that. Funny thing is that if I do not use Animate I can put the camera right up to the end of the barrel of the gun and it is fine.


MadJack(Posted 2009) [#7]
Isn't there a command that can change the bounding box on animated entities to avoid this?


wmaass(Posted 2009) [#8]
perhaps MeshCullBox mesh,x#,y#,z#,width#,height#,depth# ?? I'll try it in a bit. I assume x,y,z are the center of the mesh.


wmaass(Posted 2009) [#9]
Yep, that works! Thanks MadJack!


Adam Novagen(Posted 2009) [#10]
Is there a good FPS example around here that shows the general idea?

I believe there's one in the Samples collection of B3D itself (i.e. on your computer, not this website) I think it's either called "shooter" or "scare", something like that.


wmaass(Posted 2009) [#11]
I looked at that before posting, nice example of general concept but it did not have the hands or weapon.