Home   Help Search Login Register  

Author Topic: camera problems  (Read 1711 times)

0 Members and 1 Guest are viewing this topic.

Offline neilreed

  • Members
  • *
camera problems
« on: 11 Nov 2007, 23:07:26 »
Hello , people , iam having some trouble with a basic camera script , i want  to place this camera in front of player 5 meters and 1 meter up  but i get a position in the middle of the sea, with the camera bouncing up and down ? iam using desert island  please can anyone see what iam doing wrong

sample script ,

_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]


_cam camsettarget player
_cam camsetrelpos [0,0.5,1]
_camera camSetFOV 0.700
_camera camCommit 0
~8


_cam cameraeffect ["terminate", "back"]
camdestroy _cam

titlecut [" ","BLACK IN",2]


exit

 

Offline schuler

  • Contributing Member
  • **
Re: camera problems
« Reply #1 on: 11 Nov 2007, 23:22:13 »
you have cam set by you need to use @camcommitted _cam to start it, ,, look at the @camcommitted _cam in this code
thats where the cam starts to run..

Quote
; for the intro camera scripting tutorial

; create camera
_cam = "camera" camcreate [0,0,0]
_cam cameraeffect ["internal", "back"]

; point the camera at the player, and place it 2m to the players left,
; 10m to his front and 3m above the ground
_cam camsettarget player
_cam camsetrelpos [-2,10,3]
_cam camcommit 0

; fade in from black over 2 seconds
titlecut [" ","BLACK IN",2]

; wait for 2 seconds for the fade to complete
~2

; move the camera to 5m behind the player, 2m to his left and 0.5m above the ground
; do the move over 10 seconds, and then wait for 2 seconds
_cam camsetrelpos [-2,-5,0.5]
_cam camcommit 10
@camcommitted _cam
~2

; target object2, moving the camera to a relative position that is
; 3m in front, 1m to the left and 2m above the ground. Move over 10 seconds, then wait for 2.
_cam camsettarget object2
_cam camsetrelpos [-1,3,2]
_cam camcommit 10
@camcommitted _cam
~2

; fade out to black over 2 seconds
titlecut [" ","BLACK OUT",2]

; wait for 2 seconds for the fade to complete
~2

; end cutscene
_cam cameraeffect ["terminate", "back"]
camdestroy _cam

; fade back in over 2 seconds
titlecut [" ","BLACK IN",2]

exit

to make it bounce adjust the height by 0.3 maybe even smaller 0.2
then august the _camera camCommit 0 to _camera camCommit 0.2 or more or less and set the
@camcommitted _cam 0.2
~0.2 or to what you have the  _camera camCommit 0.2  set to in time, you'll have to play around a bit to get the right bounce you want. hope that helps  :)
« Last Edit: 11 Nov 2007, 23:42:40 by schuler »
Semper Fi

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: camera problems
« Reply #2 on: 12 Nov 2007, 02:06:28 »
your problem lies here:

Code: [Select]
_cam camsettarget player
_cam camsetrelpos [0,0.5,1]
_camera camSetFOV 0.700
_camera camCommit 0
~8

the camera has been created using the variable _cam, but you use the variable _camera for the commit part. it should all be the one variable, either _cam or _camera, but not both.

Offline neilreed

  • Members
  • *
Re: camera problems
« Reply #3 on: 12 Nov 2007, 03:16:23 »
thanks guys that helped a lot :good:
i see my mistake now.