|
To set your 3D model to appear in a certain position (at an angle that best shows off the product), simply follow the below steps. This process is well-defined and requires no trial and error of changing the matrix co-ordinates.
- Open up your Flash MX file.
- Create a temporary button.
- Add the following code to this button:
on (press){ trace(_root.renderWindow.getCamera().matrix); }
- Publish the presentation to produce the Blaze 3D web presentation with this additional temporary button.
- While viewing the published web presentation, use your mouse to manipulate the 3D model to the desired position.
- Click the temporary button to which you attributed the getCamera().matrix code
(0.9106027, 0.051471334, 0.41006526, -0.06702793, 0.997471, 0.023641724, -0.4078113, -0.04901404, 0.9117497, 5.780526, -0.3760997, -12.465586);
- If you would like to understand more about what these values mean, refer to the Matrix3d class.
- Copy and paste this number matrix from the console and store it using a suitable variable, for example if we wanted to define a reset position that our model would move to when the user clicked a reset button, we could use the following ActionScript code:
reset = new Matrix3d(0.9106034, 0.051470235, 0.41006526, -0.06702833, 0.9974702, 0.023642153, -0.40781078, -0.049014397, 0.91174966, 5.780526, -0.376099, -12.465586);
_root.renderWindow.gotoposMatrix = _root.reset; //Here 'reset' is the name of the variable which contains the required position matrix
_root.renderWindow.gotoposFrames = 20; //Move the model to our matrix position over 20 frames.
_root.renderWindow.gotoposStart = true; //Move to the position now
- Publish the presentation with your new defined position and view the published web presentation.
- If you are happy with the position, and have no more positions to define then remove the temporary button (by deletion or you can simply put it in a guide layer).
|