Scaling and Following FancyCar Model

I have implemented the FancyCar code into my project and I really like it. There are a couple of issues that should have quick answers:


  1. When I scale the model (player.scale(3)), the entire model scales, including the wheels, but the wheels are located near the center of the model instead of where they should be. I'm sure I need to apply a translation to each of the wheel nodes, but I want to know if there is a simpler way first.


  2. I am trying to get the camera to follow the car. I can position the camera behind the car, but I can't get the camera to rotate as the car rotates. I don't have much experience with Quaternions, which are used for the rotation, but I have this in my program:

Quaternion carRotation = car.getPlayer().getLocalRotation();
cam.setRotation(carRotation.fromAngleAxis(FastMath.PI, Vector3f.UNIT_Y));


I know the problem resides in this code, so I'm probably guessing I will have to change these two lines to get the camera to rotate properly.

Thanks!

Hi,



try it with

cam.setAxes(car.getLocalRotation());