Posts Tagged ‘Tutorials’
This Part of the Shaders Tutorial series will show you how to add Phong vshader to either a dae imported object or to a basic primitive.
If you are a novice, it is advised that you follow this tutorial from the initial section that can be found here, which explains how to set up the files and the scene. Otherwise please read on.
For those following on the shaders tutorial series, i will be calling this .as file phongMat
package phongMat { import flash.display.Sprite; import flash.events.Event; import flash.text.TextField; import flash.text.TextFormat; import org.papervision3d.cameras.CameraType; import org.papervision3d.lights.PointLight3D; import org.papervision3d.materials.shadematerials.PhongMaterial; import org.papervision3d.materials.utils.MaterialsList; import org.papervision3d.objects.primitives.Sphere; import org.papervision3d.render.BasicRenderEngine; import org.papervision3d.view.BasicView; import org.papervision3d.objects.parsers.DAE; import org.papervision3d.objects.DisplayObject3D; public class phongMat extends Sprite {
This is a tutorial showing how to create a very clean and basic preloader for Flash CS3, using Actionscript 3.
to begin with we must create our file.
- click on File > New or (Ctrl + N)
- Select Flash Actionscript3 and click ok
- No we must give it a name, so Click File > Save As and give it a name, i called mine preloader
- Once this is done we have the ablity to start editing our file
As usual you can set the file size for the document etc from the properties tab, but you can leave the settings as default if you like.
We now must create a new layer and call it actions, now in frame 1 of the actions tab (if you can not see the Actions tab, press F9) and type the following code:
This Part of the Shaders Tutorial series will show you how to add Flat shader material to either a dae imported object or to a basic primitive.
If you are a novice, it is advised that you follow this tutorial from the initial section that can be found here, which explains how to set up the files and the scene. Otherwise please read on.
For those following on the shaders tutorial series, i will be calling this .as file flatMat
to begin with we must begin the package and import the relevant classes
package flatMat { import flash.display.Sprite; import flash.events.Event; import flash.text.TextField; import flash.text.TextFormat; import org.papervision3d.cameras.CameraType; import org.papervision3d.lights.PointLight3D; import org.papervision3d.materials.shadematerials.FlatShadeMaterial; import org.papervision3d.materials.shadematerials.CellMaterial; import org.papervision3d.materials.utils.MaterialsList; import org.papervision3d.objects.primitives.Sphere; import org.papervision3d.render.BasicRenderEngine; import org.papervision3d.view.BasicView; import org.papervision3d.objects.parsers.DAE; import org.papervision3d.objects.DisplayObject3D;
now we must begin the class, and add the variables that we will be using
This Part of the Shaders Tutorial series will show you how to add Cell shader to either a dae imported object or to a basic primitive.
If you are a novice, it is advised that you follow this tutorial from the initial section that can be found here, which explains how to set up the files and the scene. Otherwise please read on.
For those following on the shaders tutorial series, i will be calling this .as file cellMat
package cellMat{
we then need to import our classes
import flash.display.Sprite; import flash.events.Event; import flash.text.TextField; import flash.text.TextFormat; import org.papervision3d.cameras.CameraType; import org.papervision3d.lights.PointLight3D; import org.papervision3d.materials.shadematerials.CellMaterial; import org.papervision3d.materials.utils.MaterialsList; import org.papervision3d.objects.primitives.Sphere; import org.papervision3d.render.BasicRenderEngine; import org.papervision3d.view.BasicView; import org.papervision3d.objects.parsers.DAE; import org.papervision3d.objects.DisplayObject3D;
now we must initiate our class, and set our variables
public class cellMat extends Sprite { private var view:BasicView; private var cell:CellMaterial; private var light:PointLight3D; private var sphere:Sphere; private var angle:Number = new Number(0); private var tf:TextField; private var format:TextFormat; private var dae:DAE; private var daeFile:String; private var daeMaterialName:String;
This Part of the Shaders Tutorial series will show you how to add colorMaterial shader to either a dae imported object or to a basic primitive.

Colour Material Shader Example
If you are a novice, it is advised that you follow this tutorial from the initial section that can be found here, which explains how to set up the files and the scene. Otherwise please read on.
This code is pretty basic / self explanatory, so I will not be explaining much about it. If you do require any help, just post a comment below.
package colorMat {
import flash.display.Sprite;
import flash.events.Event;
import flash.text.TextField;
import flash.text.TextFormat;
import org.papervision3d.cameras.CameraType;
import org.papervision3d.materials.ColorMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.primitives.Sphere;
import org.papervision3d.render.BasicRenderEngine;
import org.papervision3d.view.BasicView;
import org.papervision3d.objects.parsers.DAE;
import org.papervision3d.objects.DisplayObject3D;
public class colorMat extends Sprite
{
private var view:BasicView;
private var color:ColorMaterial;
private var sphere:Sphere;
private var tf:TextField;
private var format:TextFormat;
private var dae:DAE;
private var daeFile:String;
private var daeMaterialName:String;