@Enlightened Gamer
Quote: "I lock the model to the camera using the "lock object on" command as it is a lot simpler then positioning the model just infront of the camera and getting the ground hide of the camera and making it rotate with the camera etc.
When the models (I have tried more then one) are just positioned on the matrix they look how they are meant to so it should not be the models fault (I even tried with the models provided in the media area and the examples).
Can anyone explain the reason that this is happening?"
Hello.
While Lock Object On is convenient, it's not really too great for locking guns or tools to the camera perspective. What happens, and what seems to be what you are describing, is the clipping planes (the viewing area in which 3d is drawn) for the object that is locked is handled a little differently than non-locked objects. Objects within a certain proximatey to the camera can appear 'clipped' or not completely drawn. The Z-Depth (a control that allows one object to be drawn in front or behind another object) is disabled for the locked object and that object will always appear in front of other objects. The clipping combined with the Z-Depth (and other things) can make your locked objects seem partially see-through or like they are missing some parts. There's no correction that I know of except for not using Lock Object On for weapons.
It's best not to use Lock Object On for guns or anything carried. It works best for 2d type displays like a radar or a map or control panel that is always displayed on screen and projected onto something like a plane. It's much better to position the object with math or with limbs.
Here's a quick example of using a cylinder as a gun and attaching it as a limb to a cube that is rotated and placed at the camera's position and orientation. Steer with the mouse, move with the up/down arrows:
sync on
autocam off
hide mouse
rem for reference
make matrix 1,1000,1000,25,25
rem make the gun and offset it so the rotation is at the base and not the middle
make object cylinder 1,5
scale object 1,100,1000,100
make mesh from object 1,1
delete object 1
make object 1,1,0
rem rotate culinder so it points into the screen
xrotate object 1,90
make mesh from object 1,1
delete object 1
make object 1,1,0
rem offset it in the z direction to change the rotation point
offset limb 1,0,0,0,25
make mesh from object 1,1
delete object 1
rem make a cube as the main object that the gun will be a limb of
make object cube 2,1
add limb 2,1,1
offset limb 2,1,10,-5,10
rem when ever an object is set to the cameras orientation, it's
rem rotation order is opposite
set object rotation zyx 2
position camera 500,30,500
do
gosub _move_camera
rem position and rotate the cube to the camera. The gun limb will follow
rem the cubes rotation and maintain it's offsets and transformations
position object 2, camera position x(),camera position y(),camera position z()
set object to camera orientation 2
sync
loop
`----------------------------------------------------------------
_move_camera:
move camera (upkey()-downkey())*5
yang#=wrapvalue(camera angle y()+mousemovex())
xang#=wrapvalue(camera angle x()+mousemovey())
yrotate camera yang#
xrotate camera xang#
return
`----------------------------------------------------------------
Enjoy your day.