away3d/away3d-core-fp11 — Issue #191: Skybox and Sound3D position bug
Author: matse4
Created: 2011-11-30 17:11:10+00:00
State: open

We had a problem with Camera Movement and Skybox/Sound3D, i played a bit with it and found and solution for me, don't know if there is an reason to not implement it this way.

Sound3D:
I changed this
```public function update():void
{
_inv_ref_mtx.rawData = _reference.sceneTransform.rawData;
_inv_ref_mtx.invert();
_refv = _inv_ref_mtx.deltaTransformVector(_reference.position);
_refv = this.scenePosition.subtract(_refv);
_driver.updateReferenceVector(_refv);
}```
to
```public function update():void
{
_refv = _reference.scenePosition;
_refv = this.scenePosition.subtract(_refv);
_driver.updateReferenceVector(_refv);
}```

SkyBox:
I changed at line 168
```mvp.appendTranslation(camera.x, camera.y, camera.z);```
to
```mvp.appendTranslation(camera.scenePosition.x, camera.scenePosition.y, camera.scenePosition.z);```

cheers Matse