First Personal Shooter Camera?

Software: Away3D 4.x

Haunter66, Newbie
Posted: 16 November 2012 10:09 PM   Total Posts: 4

Hi! I’m kind of new to Away3D and I can’t manage to solve this. I’m trying to make a FPS camera for a maze game. So far I tried to create a AWPRigidBody with a AWPSphereShape and to move it around the maze with applyCentralForce, then make the camera follows the sphere position. It doesn’t look bad but I don’t know how to:

- modify the friction between the floor and the sphere. It looks like the floor is made of ice.

- and rotate the sphere along with the camera so I can look around with the mouse y position. Even when I modify the sphere rotationY the directions don’t change.

Any suggestions? I’m I taking the wrong approach?

Thank you for your help =)

   

Babylon, Jr. Member
Posted: 20 November 2012 05:32 AM   Total Posts: 39   [ # 1 ]

Ice you say? Try playing around with these settings

sphereBody.angularDamping .99999;
   
sphereBody.linearDamping .99999;
   
sphereBody.friction 0;
   
sphereBody.mass 1

FPS shooter camera:

import away3d.controllers.*;
 
import away3d.controllers.HoverController;
private var 
cameraController:HoverController;

cameraController = new HoverController(view.cameraMeshToLookAt00DISTANCE_FROM_MESH);

cameraController.minTiltAngle = -85
   cameraController
.maxTiltAngle 85;
   
cameraController.distance = -1;
   
cameraController.tiltAngle 0;

cameraController.lookAtObject physSphere

I change the max tilt because I find when it looks all the way up, it inverts. Don’t know why.

Adjust with KEYPRESSES W A S D

cameraController.panAngle -= 90;
cameraController.panAngle += 90;
cameraController.tiltAngle -= 90;
cameraController.tiltAngle += 90

goodluck

   

Haunter66, Newbie
Posted: 21 November 2012 06:08 PM   Total Posts: 4   [ # 2 ]

Great!! Thank you Babylon, was exactly what I was trying to do (also I’m impress that my approach wasn’t wrong at all)

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X