A 3D vector renderer written in ActionScript2 and integrated with the Advanced Virtual Camera
- Macromedia Flash 8 - Adobe Flash CS6
- ActionScript 2 set in publish settings
- Basic knowledge of ActionScript
Download the Renderer and the VCam code from here:
- Get the Advanced Virtual Camera for AS2 from Google Drive
- Following this tutorial, setup the Camera and the Control Panel
- Enter the Camera symbol ("SHURIKEN255_CAMERA"), right-click on the frame with an "a" symbol on it, and select "Actions"
- In the opened window ("Actions"), select all the code and delete it. After that, replace it with the code from vcam.as
- Go to the root level of your scene, create a new layer. On the first blank of the layer open the "Actions" panel again and paste in the code from renderer.as
It should be properly setup now!
Open the "Actions" panel for the frame with the Renderer code and scroll down until you see //Draw down here
line of code. All your code for drawing will go below that line
To create a drawing object, type in the following above the //Draw down here
line:
_root.createEmptyMovieClip("name", root.getDepth() - depth)
, where name
is the name you will have to reference later, and depth
is the Z level you want your layer to be at.
Before drawing lines, you will have to set a linestyle for your Drawing Object like this:
_root.name.lineStyle(thickness,rgb,alpha,pixelHinting,noScale,capsStyle,jointStyle,miterLimit);
You can read about all those values in the ActionScript2 documentation
To draw a line type in the following line of code:
drawLine(points, object, closed);
, where object
is the name of the Drawing Object you have created in the last step, and closed
(can either be true
or false
) determines whether or not the path should be closed.
points
is the parameter where you define all the coordinates for the path. It should look like this:
drawLine([{},{},{},...{}], object, closed)
(each pair of curly braces is one point, you can have as many as you want).
Inside of each point you need to specify its x, y and z coordinates:
(one point example) {x: 200, y: 400, z: 50}
WIP