juliancruz87 wrote:
good morning, I tried to make the camera move like this example
http://www.bandit3.com/, which is a natural movement, but I used the
moveTo () method, which contains the camera, and does not work ,,,
Just shows up at that point without moving gradually to get there,
with that method I do this?, Thanks!
http://www.bandit3.com/
something like:
have a google for TweenMax, and make sure it is imported correctly into
your project...
try this:
----
// imports for TweenMax engine
import com.greensock.TweenMax;
import com.greensock.easing.*;
import com.greensock.plugins.*;
// setup debug turn off for production
var debug:Boolean = true;
// setup hoverCam
var hoverCam:HoverCamera3D = new HoverCamera3D();
// setup tracking object - does not need to be a cube it can be anything..
var trackingItem:Cube = new Cube();
// set tracking item size, again can be anything you want customise it
to suit
trackingItem.width = trackingItem.depth = trackingItem.height = 5;
trackingItem.x = 0;
trackingItem.y = 0;
trackingItem.z = 0;
trackingItem.alpha = 0;
// for debugging
if (debug) {
trackingItem.alpha = 1;
}
// set the camera target
hoverCam.target = trackingItem
// dont forget to customise Tween for whichever tween engine you are
using, example shown here uses TweenMax
// you can use any of the easing functions from tween library
// TweenMax.to(OBJECTtoTween, tweenDuration, {properties to tween....});
TweenMax.to(trackingItem, 1, {x:100,y:100, z:100, ease:Quart.easeOut});
----