Quantcast

Jump to content

» «
Photo

Camera movement ?

2 replies to this topic
MOrdecki
  • MOrdecki

    Scripter

  • Members
  • Joined: 10 Jul 2006
  • Poland

#1

Posted 29 December 2012 - 02:45 PM

Hey, does anyone know the correct functions which would move my camera from point A to point B smoothly ?

giovafr
  • giovafr

    Player Hater

  • Members
  • Joined: 12 Jun 2013

#2

Posted 06 July 2013 - 10:55 AM

i'd like to know me too.

Moreover i'd like to change FOV smoothly, something like :

CODE
///From current FOV to NextFOV smoothly
SmoothFOV(Camera cam,float NextFov,int duration);

julionib
  • julionib

    Coder

  • Feroci Racing
  • Joined: 13 Sep 2012
  • Brazil

#3

Posted 06 July 2013 - 01:33 PM

i dont know if exists an automatic way but the way i do is increment the camera pos with the movement direction:

first i calc direction that is the difference between destination and camera position:

CODE
dir = vector3.normalize(dest - cam.position)


then, in a Tick, While, For or whatever i increment the position with an 10ms interval (generally):

CODE
cam.position += dir * 0.1


the * 0.1 its just to reduce the speed of the movement




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users