Away3D Lathe tutorial

Flash, Tutorials

lathe

This tutorial shows you how to use the Lathe class using the Away3D 1.9.4 library or higher. The class is located in the extrusions package.

A word about the Lathe class
The Lathe class allows you to generate a mesh at runtime from an array of Number3Ds rotated around a given axis. With it, you can generate simple shapes like a cylinder, or more visually complex ones like a bottle, glass, vase or spring. It also offers the ideal solution to generating a panoramic skyline where the mesh needs to take up only a portion of the screen, but creates a 360° environment.
As well as a great diversity of properties, generation can be easily automated allowing you to create shapes from an xml definition file, DB, webservice etc. Since you do not need to load geometry definition files, loading time of your project is reduced when using the lathe.

The class contains a lot of properties that allow you to get many different results from simple changes in the constructor.

The properties:
– axis:String – the axis around which the lathe rotates.
– rotations:Number – the number of rotations used. Note that integers (whole rotations) are not necessary. The minimum possible value is 0.1.
– subdivision:int – how many segments define the geometry, the default is 2.
– offsetradius:int – offsets all points from the rotation axis, the default is set to 0.
– scaling:Number – global scale for the produced object, the default is set to 1.
– materials:Object – multiple materials (see below for details).
– material:IMaterial – a single material defined on your model.
– omit:String – string that defines which part of the geometry can be ignored during the building process: possible values include “front, back, top, bottom, left, right”, the default is set to “”. Note that this is only applicable if the thickness is greater than 0.
– tweek:Object – object containing cumulative offset values to generate spring like shapes (see below for more details).
– thickness:Number – the thickness of the produced shape, non-zero values create an evenly distributed inner and outer side from the central values of the rotated vertices, the default is set to 0.
– coverall:Boolean – true if the texture is stretched over the entire geometry, otherwise it is repeated per segment, the default is set to true.
– recenter:Boolean – true if the generated object has its pivot point set at the center of it’s geometry, otherwise it is defined as the first Number3D passed to the constructor, the default is set to false.
– flip:Boolean – true if the faces generated require reversing, the default is set to false.

Below is a graphical representation of a resulting Lathe object with color-coded property representations.

tweek1
Click to enlarge

material and materials properties:
To apply a single material to the lathe class the property material:IMaterial is used like any other primitive, which will cover the whole geometry by default or per-segment if the coverall property is set to false.

In cases where the thickness option is used, you can apply multiple materials on the same lathe object: defined as front, back, top, bottom, left, right and defaultmaterial in the materials object. For example:

var oMat:Object = {front:material1,
                   back:material2,
                   left:material2,
                   defaultmaterial:anothermat};

can be passed to the init object like so:

var lathe = new Lathe(points, {materials:oMat})

Note that the object property defaultmaterial takes the place of the omitted definitions for top, bottom, right and up. This can be used, for instance, if you were creating a lathe object for a plate. You would use a porcelain texture everywhere except on the front where you would add some extra colors defined in a “front” material.

How to implement the Lathe class into your code
The first thing you need to do is import the Lathe and Number3D classes into your project class. The Number3D class is required to define the “profile points” you want to rotate around the given axis.

import away3d.extrusions.Lathe;
import away3d.core.math.Number3D;

The following example represents a lathe definition for a simple glass shape.

private function generateLatheObject():void
{
	var aPoints = new Array();
	aPoints.push(new Number3D(280, 250, 0));
	aPoints.push(new Number3D(250, 0, 0));
	aPoints.push(new Number3D(0, 0, 0));

	var mat:BitmapMaterial = new BitmapMaterial(myBitmapData); 
	var lathe:Lathe = new Lathe(aPoints, {material:mat,
                                          axis:"y",
                                          rotations:1,
                                          subdivision:10,
                                          coverall:true,
                                          recenter:true});
	scene.addChild(lathe);
}

if finer definition is required, you can increase the value of the “subdivisions” property, and add more Number3Ds to the profile points array. This would display the same shape on screen, but with many more faces.

var aPoints = new Array();
aPoints.push(new Number3D(280, 250, 0));
aPoints.push(new Number3D(265, 125, 0));
aPoints.push(new Number3D(250, 0, 0));
aPoints.push(new Number3D(125, 0, 0));
aPoints.push(new Number3D(0, 0, 0));

To add thickness, just pass thickness:value in the init object

The tweek object:
If you pass a tweek object to the init object, tweek:{x:Number,y:Number,z:Number,radius:Number} you can influence the circular way vertices are generated. The defined x, y and z values add a cumulative offset to the points as they are rotated, in the x, y and z directions respectively. The radius value adds a cumulative offset radially from the central axis of the lathe.

A few examples using the tweek object.

Here same as above, we define a profile from an array of Number3Ds, in this case forming a flipped “C” shape.

var aPoints = new Array();
aPoints.push(new Number3D(100, 300, 0));
aPoints.push(new Number3D(200, 200, 0));
aPoints.push(new Number3D(200, 100, 0));
aPoints.push(new Number3D(100, 0, 0));

tweek1

var lathe:Lathe = new Lathe(aPoints, {material:mat, 
                                      axis:"y",
                                      rotations:3,
                                      subdivision:40,
                                      scaling:1,
                                      coverall:true,
                                      recenter:false
                                      tweek:{x:0,
                                             y:10,
                                             z:0,
                                             radius:400},
                                      bothsides:true});

tweek2

var lathe:Lathe = new Lathe(aPoints, {material:mat,
                                      axis:"y",
                                      rotations:6,
                                      offset:-400,
                                      subdivision:60,
                                      scaling:1,
                                      coverall:true,
                                      recenter:false
                                      tweek:{x:0,
                                             y:1.5,
                                             z:0,
                                             radius:100},
                                      bothsides:true});

tweek3

var lathe:Lathe = new Lathe(aPoints, {material:mat,
                                      axis:"y",
                                      rotations:1.5,
                                      subdivision:60,
                                      scaling:1,
                                      coverall:true,
                                      recenter:false,
                                      tweek:{x:0,
                                             y:5,
                                             z:0,
                                             radius:0},
                                      bothsides:true});

Watch Full Movie Roommates Wanted (2016)

Classes, Tutorials
Backdrop Movie Roommates Wanted 2016

Roommates Wanted (2016) HD

Director : François Desagnat.
Release : April 20, 2016
Country :
Language : Magyar, Français.
Runtime : 99 min.
Genre : Comedy.

‘Roommates Wanted’ is a movie genre Comedy, was released in April 20, 2016. François Desagnat was directed this movie and starring by André Dussollier. This movie tell story about When recently widowed, it is difficult to get used to a new life … This is the case for Hubert Jacquin, who spends most of his time in his huge apartment, depressed, in front of his TV. One day, after a misunderstanding, his life will change. Manuela, a young and bubbly adventurer in search of a dwelling calls his home! At first reluctant, Hubert will quickly get used to the presence of this energy storm, who even manages to convince him to allow two other people to stay. There are many surprises in store for Hubert …

Streaming Movie Roommates Wanted (2016)

Do not miss to Watch movie Roommates Wanted (2016) Online for free with your family. only 2 step you can Watch or download this movie with high quality video. Come and join us! because very much movie can you watch free streaming.

Watch and Download Movie Roommates Wanted (2016)
Incoming search term :

Roommates Wanted 2016 Full Episodes Watch Online
film Roommates Wanted online streaming
Roommates Wanted 2016 HD Full Episodes Online
watch full film Roommates Wanted 2016
Roommates Wanted 2016 film
Roommates Wanted 2016 For Free online
Roommates Wanted 2016 English Full Episodes Watch Online
Roommates Wanted 2016 Watch Online
watch full Roommates Wanted film online
Roommates Wanted 2016 English Full Episodes Free Download
Watch Roommates Wanted 2016 Online Viooz
Roommates Wanted 2016 Full Episodes Online
Roommates Wanted live streaming movie
Roommates Wanted 2016 movie trailer
Watch Roommates Wanted 2016 Online Megashare
download film Roommates Wanted 2016
Watch Roommates Wanted 2016 Online Putlocker
Roommates Wanted 2016 Episodes Online
Roommates Wanted live streaming film online
Roommates Wanted 2016 Full Episode
Roommates Wanted 2016 English Episodes Free Watch Online
Watch Roommates Wanted 2016 Online Free putlocker
Roommates Wanted 2016 For Free Online
Roommates Wanted 2016 English Full Episodes Download
Roommates Wanted 2016 Episodes Watch Online
Watch Roommates Wanted 2016 Online Free Putlocker
Watch Roommates Wanted 2016 Online Free megashare
download full movie Roommates Wanted
download Roommates Wanted 2016 movie now
download Roommates Wanted 2016 movie
Roommates Wanted 2016 English Full Episodes Online Free Download
Roommates Wanted 2016 English Episode
download movie Roommates Wanted 2016 now
Watch Roommates Wanted 2016 Online Free Viooz
live streaming movie Roommates Wanted online
Roommates Wanted 2016 Online Free Megashare
watch Roommates Wanted 2016 movie now
Watch Roommates Wanted 2016 Online Free
streaming Roommates Wanted 2016 film
Roommates Wanted 2016 HD English Full Episodes Download
Roommates Wanted 2016 English Episodes
streaming film Roommates Wanted 2016

Watch Movie Online Trolls (2016) subtitle english

Tutorials
Poster Movie Trolls 2016

Trolls (2016) HD

Director : Mike Mitchell, Walt Dohrn.
Producer : Gina Shay.
Release : October 13, 2016
Country : United States of America.
Production Company : Twentieth Century Fox Film Corporation, DreamWorks Animation.
Language : English.
Runtime : 90 min.
Genre : Adventure, Animation, Family.

‘Trolls’ is a movie genre Adventure, was released in October 13, 2016. Mike Mitchell was directed this movie and starring by Anna Kendrick. This movie tell story about Lovable and friendly, the trolls love to play around. But one day, a mysterious giant shows up to end the party. Poppy, the optimistic leader of the Trolls, and her polar opposite, Branch, must embark on an adventure that takes them far beyond the only world they’ve ever known.

Do not miss to Watch movie Trolls (2016) Online for free with your family. only 2 step you can Watch or download this movie with high quality video. Come and join us! because very much movie can you watch free streaming.

Watch movie online Trolls (2016)

Incoming search term :

download film Trolls now
watch full film Trolls online
Trolls 2016 English Episodes Free Watch Online
Trolls 2016 For Free Online
Trolls 2016 Full Episode
Watch Trolls 2016 Online Free megashare
Watch Trolls 2016 Online Viooz
download full film Trolls 2016
Trolls 2016 Full Episodes Watch Online
Trolls 2016 English Full Episodes Free Download
Trolls 2016 English Episodes
Trolls 2016 For Free online
Watch Trolls 2016 Online Free putlocker
Watch Trolls 2016 Online Putlocker
Trolls 2016 Full Episodes Online
movie Trolls 2016 download
watch film Trolls 2016 now
Watch Trolls 2016 Online Free Viooz
film Trolls 2016 streaming
Trolls 2016 HD English Full Episodes Download
watch Trolls movie online now
Trolls 2016 Episodes Watch Online
Watch Trolls 2016 Online Free Putlocker
watch full movie Trolls
Watch Trolls 2016 Online Megashare
watch full film Trolls 2016
Trolls 2016 English Full Episodes Download
download Trolls movie now
Trolls 2016 Episodes Online
Trolls 2016 HD Full Episodes Online
Trolls 2016 live streaming film
Trolls 2016 Online Free Megashare
film Trolls 2016 download
Watch Trolls 2016 Online Free
Trolls 2016 English Full Episodes Online Free Download
Trolls 2016 English Episode
watch full Trolls film online
live streaming movie Trolls
Trolls 2016 movie download
watch full Trolls 2016 film
live streaming movie Trolls 2016 online
Trolls 2016 English Full Episodes Watch Online
Trolls 2016 Watch Online