private function init3d():void
{
scene=new Scene3D();
myCamera=new HoverCamera3D({distance:1000});
myCamera.tiltangle=0;
myCamera.targettiltangle=0;
view=new View3D({scene:scene, camera:myCamera,
x:(stage.stageWidth/
2), y:(stage.stageHeight/2)});
addChild(view);
view.render();
}
private function listeners():void
{
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(e:Event):void
{
var x:int=-((mouseX-(stage.stageWidth/2))*0.005);
var y:int=-((mouseY-(stage.stageHeight/2))*0.005);
myCamera.targetpanangle=x;
myCamera.targettiltangle=y;
myCamera.hover();
view.render();
}
On 3 мар, 16:03, Stefan <[email protected]> wrote:
> Hello guys,
>
> this is my first post, so before I start with my problem I'd like to
> thank you all for this community - you already helped me a lot!
>
> I've set up a little room (actually just some planes for a floor and
> walls) and a HoverCamera3D, which is I guess is perfect for "looking
> around the room".
> Now I would like to move the camera smoothly to another place in the
> room and "look around" from there.
>
> I tried to target the camera to a cube (that was advised here in the
> group quite a few times) and move the cube around in the room, but
> whatever distsance I set, the camera orbits around the origin - it
> kind of only "looks" at the cube but rotates around the origin.
>
> Then I tried to move the room's pivot point which works so far. Guess
> I need to use a tweening class to get the movement smooth.
>
> But is this the way to do it or am I going totally off the track here?
>
> Any hints and advice is strongly appreciated!
>
> Regards,
> Stefan