Create two cameras, one for the main render and a second one to render the hand and gun (plus possibly your heads-up-display if you're using a 3d HUD).
Position the second camera setup somewhere where it won't interfere with your main world area (I put mine 500 units below the main world area), and give it a max entity distance value that clips as close to the second camera as you can get to prevent your main world from being rendered by the second camera.
Give the second camera an entityorder of -1 to force it to render last (this won't stuff up the z-ordering for the models the way it will if you use entityorder directly on models) and use 'CameraClsMode <second camera>, False, True' to stop the second camera from clearing the background where your main world will be rendered.
eg.
Function CreateHUD()
; -- Setup HUD camera
HUD_camera = CreateCamera()
PositionEntity HUD_camera, 0.0, -500.0, 0.0
CameraRange HUD_camera, 0.2, 5.0
CameraZoom HUD_camera, 1.6
CameraClsMode HUD_camera, False, True
EntityOrder HUD_camera, -1
End Function
You may also want to consider making your hand and gun model smaller by using ScaleMesh or ScaleEntity, and move them closer to the camera, if they're poking through a wall that's six feet away. Personally though, I have some doubts about the perspective that Blitz3D uses. Everything generally looks half the size it should.
To get correct lighting on the hand and gun models, parent them to the second camera and rotate the second camera to match the rotation of your game character. If this interferes with the lighting on any 3D HUD graphics you may have, you may need a third camera for the HUD graphics.
--
Position the second camera setup somewhere where it won't interfere with your main world area (I put mine 500 units below the main world area), and give it a max entity distance value that clips as close to the second camera as you can get to prevent your main world from being rendered by the second camera.
Give the second camera an entityorder of -1 to force it to render last (this won't stuff up the z-ordering for the models the way it will if you use entityorder directly on models) and use 'CameraClsMode <second camera>, False, True' to stop the second camera from clearing the background where your main world will be rendered.
eg.
Function CreateHUD()
; -- Setup HUD camera
HUD_camera = CreateCamera()
PositionEntity HUD_camera, 0.0, -500.0, 0.0
CameraRange HUD_camera, 0.2, 5.0
CameraZoom HUD_camera, 1.6
CameraClsMode HUD_camera, False, True
EntityOrder HUD_camera, -1
End Function
You may also want to consider making your hand and gun model smaller by using ScaleMesh or ScaleEntity, and move them closer to the camera, if they're poking through a wall that's six feet away. Personally though, I have some doubts about the perspective that Blitz3D uses. Everything generally looks half the size it should.
To get correct lighting on the hand and gun models, parent them to the second camera and rotate the second camera to match the rotation of your game character. If this interferes with the lighting on any 3D HUD graphics you may have, you may need a third camera for the HUD graphics.
--