Hi everyone!
I’m new at this, so forgive me if i’m asking questions already answered (i’m sure), butI’m having trouble with a mesh i have imported to my project.
I try to move it forward whenever the up key is pressed, but then only a part of the model moves. It’s a car, and the only thing that moves is the wheel rims.
This is what i do to load and to try and move the car:
private function addCar():void
{
Parsers.enableAllBundled();
var parseador:AssetLoaderContext = new AssetLoaderContext();
Loader3D.enableParser(Max3DSParser);
meshLd = new Loader3D();
meshLd.addEventListener(AssetEvent.ASSET_COMPLETE, meshLdHandler);
meshLd.load( new URLRequest("audi/a4_a.3DS"), parseador);
}
private function meshLdHandler(e:AssetEvent):void
{
if(e.asset.assetType == AssetType.MESH)
{
car = e.asset as Mesh;
car.position = new Vector3D(50,0,5);
car.geometry.scale(20)
camCnt = new HoverController(cam,car);
camCnt.distance = 100;
camCnt.minTiltAngle = 0;
camCnt.maxTiltAngle = 90;
camCnt.panAngle = 0;//45
camCnt.tiltAngle = 20;
scene.addChild(car);
}
private function kbHandler(e:KeyboardEvent):void
{
if(e.keyCode == Keyboard.UP)
{
car.moveForward(1);
}
}
I’ve looked for some example of how to accomplish this, but no luck so far. Hope you guys can help. Thank you!!!