Away3D PathExtrude: Cords & Ribbons

Flash

path2

Right after the Mirror class, A new addition to the Away3D library: The PathExtrude class.
The PathExtrude class projects any profile defined by Number3D’s on a given Path. Capital P to Path, because it’s also a new comer to the library. (This one will do much more later on…)

This class allows you to generate phone cords, cable, handwrited letters, ribbons, race tracks, handles etc… in just a few lines and like all the others: no third party 3d app required.

However if you play a bit with it, you’ll soon realize you’ll need to find/write a generator for the path information, doing it by hand would be very tedious if the path is extended. But for anyone that have already traced curve using the Flash API, will know exactly what I mean.Movie Rings (2017)

The demo’s are speaking for themselves… here just a few examples with some code.

The first thing is to define a profile:

var aPoints = [];
//here a U form
aPoints.push(new Number3D(-100, 0, 0));
aPoints.push(new Number3D(-50, 0, 0));
aPoints.push(new Number3D(-50, -50, 0));
aPoints.push(new Number3D(0, -50, 0));
aPoints.push(new Number3D(50, -50, 0));
aPoints.push(new Number3D(50, 0, 0));
aPoints.push(new Number3D(100, 0, 0));

Then declare a Path instance, and define the CurveSegments
import away3d.animators.data.Path;

var aPath:Path = 
new Path([ 	
new Number3D(-400, 0, -150),new Number3D(-200, 300, 0), new Number3D(0,0,0),
null, new Number3D(200, -300, 0), new Number3D(400, 0, 0),
null, new Number3D(600, 300, 0), new Number3D(800, 0, 0),
null, new Number3D(1000, -300, 0), new Number3D(1200, 0, 150)
]);

The order of the array is v0, va (anchor), v1. You would do the same to define a curve in Flash (curveTo()).
note: the null is there to save the typing since it’s the v1 from previous CurveSegment.

You can define the world axis as well, needed for the directional vector to align properly your profile.
default is 0,1,0. Depending on the profile orientation, you might need to set it.

aPath.worldAxis = new Number3D(0,0,1);

You then just pass it all this to the class

var pathextrude:PathExtrude= 
new PathExtrude(aPath, aPoints, null, {flip:false, aligntopath:true, 
coverall:true, scaling:2, closepath:false, recenter:true,
material:mat, subdivision:6, bothsides:false});
//showtime
this.scene.addChild(pathextrude);

Done!

path4

There is a cool addon too, you can influence the Path CurveSegments by passing a series of Number3D’s for the scale of the profile along the path at each points. By default it’s being smoothed from startscale to endscale per segment, if you set the property smoothscale to false, it will equally scale the whole segment.
This is especially handy when it comes to build complex shapes like a bike frame, a thea cup handle or even a spoon…

//scale variation
var aScale = [];
aScale.push(new Number3D(1, 1, 1));
aScale.push(new Number3D(2, 1, 2));
aScale.push(new Number3D(2, 1, 2));
aScale.push(new Number3D(3, 1, 3));

The scales array is applied one by one on following same indexes as the Path CurveSegments, so you can pass less scale modifiers than path segments. For instance if you would want to affect only the beginning of the mesh generation.

Here we pass the scales array this time.

var pathextrude:PathExtrude = 
new PathExtrude(aPath, aPoints, aScale, {smoothscale:true, flip:false,
aligntopath:true, coverall:true, scaling:2, closepath:false, 
recenter:true, material:mat, subdivision:6, bothsides:true});

path5

Same code with some scale changes, this time we set the smoothscale property to false.
As you can see the scale changes are only set to the segments. No matter how high the subdivision is.

var pathextrude:PathExtrude = 
new PathExtrude(aPath, aPoints, aScale, {smoothscale:false, 
flip:false, aligntopath:true, coverall:true, scaling:2, 
closepath:false, recenter:true, material:mat, 
subdivision:10, bothsides:true});

path5

In this example, we pass only the profile, and set it on the path but we do not pass scales modifiers and the property alignToPath is set to false. The profile is set on the path but no directional rotation is done. And you get a nice ribbon.I’ve set the bothsides property to flase so you can see how nice the curve is.

var pathextrude:PathExtrude = 
new PathExtrude(aPath, aPoints, null, {aligntopath:false, coverall:true, 
scaling:1, recenter:true, material:mat, subdivision:10, 
bothsides:false});

path1

Here another variation, this time the middle object is a straight path, and I pass a star like profile. This is something you would not be able to do with the Lathe class. You could do it with the Skin class. But if i would want to bend the shape, then this class only would give you the right shape.

The path generated for the second object has now an extrude as “ribbon”: the align to path is set to false.

path6

I could make tons of demos since almost each output generates an interesting shape, so one last example. Same path as the first demos, except this time I pass a circle like profile. And what do we get here? A nice cord!

This class is in the Away3D trunk. I can wait see what you guys will do with this one!

Watch Movie Online John Wick: Chapter 2 (2017) subtitle english

Flash
Poster Movie John Wick: Chapter 2 2017

John Wick: Chapter 2 (2017) HD

Director : Chad Stahelski.
Producer : Basil Iwanyk.
Release : February 8, 2017
Country : United States of America.
Production Company : Thunder Road Pictures, LionsGate, 87Eleven.
Language : English, Italiano.
Runtime : 122 min.
Genre : Thriller, Action, Crime.

Movie ‘John Wick: Chapter 2’ was released in February 8, 2017 in genre Thriller. Chad Stahelski was directed this movie and starring by Keanu Reeves. This movie tell story about John Wick is forced out of retirement by a former associate looking to seize control of a shadowy international assassins’ guild. Bound by a blood oath to aid him, Wick travels to Rome and does battle against some of the world’s most dangerous killers.

Do not miss to Watch movie John Wick: Chapter 2 (2017) 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 John Wick: Chapter 2 (2017)

Incoming search term :

Watch John Wick: Chapter 2 2017 Online Free Putlocker
Watch John Wick: Chapter 2 2017 Online Putlocker
John Wick: Chapter 2 2017 English Full Episodes Download
John Wick: Chapter 2 2017 Full Episodes Online
download John Wick: Chapter 2 2017 movie
John Wick: Chapter 2 2017 Episodes Watch Online
watch full film John Wick: Chapter 2 2017 online
John Wick: Chapter 2 2017 HD Full Episodes Online
Watch John Wick: Chapter 2 2017 Online Megashare
watch full movie John Wick: Chapter 2 2017
Watch John Wick: Chapter 2 2017 Online Free megashare
John Wick: Chapter 2 2017 Online Free Megashare
John Wick: Chapter 2 2017 English Full Episodes Free Download
Watch John Wick: Chapter 2 2017 Online Free
Watch John Wick: Chapter 2 2017 Online Free putlocker
film John Wick: Chapter 2 2017 download
John Wick: Chapter 2 2017 For Free Online
John Wick: Chapter 2 2017 Full Episodes Watch Online
John Wick: Chapter 2 2017 Episodes Online
download John Wick: Chapter 2 2017 movie now
download film John Wick: Chapter 2 now
watch full John Wick: Chapter 2 2017 film
live streaming film John Wick: Chapter 2 2017 online
John Wick: Chapter 2 2017 For Free online
Watch John Wick: Chapter 2 2017 Online Viooz
John Wick: Chapter 2 2017 Watch Online
John Wick: Chapter 2 2017 English Full Episodes Online Free Download
movie John Wick: Chapter 2 2017 trailer
John Wick: Chapter 2 2017 English Episode
John Wick: Chapter 2 2017 HD English Full Episodes Download
movie John Wick: Chapter 2 2017 streaming
John Wick: Chapter 2 2017 English Full Episodes Watch Online
trailer film John Wick: Chapter 2 2017
John Wick: Chapter 2 2017 English Episodes Free Watch Online
Watch John Wick: Chapter 2 2017 Online Free Viooz
John Wick: Chapter 2 2017 English Episodes
John Wick: Chapter 2 2017 Full Episode
streaming John Wick: Chapter 2 2017
watch full John Wick: Chapter 2 movie
John Wick: Chapter 2 2017 live streaming film online
live streaming movie John Wick: Chapter 2

Away3D Animator class tutorial

Tutorials

butterflies

This tutorial shows you how to use the Animator class using the Away3D 1.9.4 library or higher.

The Animator class allows you to generate one or more series of animation sequences and add them to the internal animation system. It could be described as a runtime md2 generator – a vertex animation format.

The vertex animations are updated at a given fps (a user defined framerate per second). The object can have one or more logical sequences, and each sequence is defined by a prefix string. Keyframes (the vertex geometry for a single frame of a sequence) in a sequence are identified by the same prefix string and a number; for instance a walk sequence would be defined as prefix: “walk”, each keyframe would then use the naming convention prefix+increment to give ‘walk0’, ‘walk1’, ‘walk2’ etc…

Once defined you are then able to change the sequences at runtime like you would do for a movieclip. (movieclip.play(“timeline anchor”);) The engine will play the frames within this sequence “timeline” until it reaches the last frame. In our walk sequence it would stop at frame walk2. the sequence can be looped by setting the loop property to true, and the animations can be smoothed (tweened) by setting the smooth property to true, otherwise the sequence plays as individual frames.

To make your Animator object you need at least two parameters: the base object (used as the starting mesh to be used for all subsequent vertex movements), and the vertices positions for each keyframe. For this reason it is important to pass the same amount of vertex positions for each keyframe. The order of vertex positions must remain coherent throughout each sequence. How to model in a 3D application is beyond the scope of the tutorial. It is possible to tween any two shapes as long as they both have the same amount of vertices.

How to implement
You only need to import 1 class using the 1.9.4 library from the animation package and for version 2.1 and higher you’ll also need the AnimationSequence class.

import away3d.animations.Animator;
//using 2.0 and higher
import away3d.core.base.AnimationSequence;

This example shows 2 meshes exported as still .as files (AS3 export is native in Away3D)
Both butterflies shapes were modeled in a third party editor.

butterfly1
As you can see, each keyframe shows a different state.
butterfly2

private function generateButterfly():void
{
 // the material
 var mat:IMaterial = new BitmapMaterial(new butterfly_texture(), {smooth:false}); 

//instance of the first as3 file (you could create the same using a loader)
 var but1:Butterfly1 = new Butterfly1({scaling:0.6});

//instance of the second as3 file
 var but2:Butterfly2 = new Butterfly2({scaling:0.6});

// instance Animator
 // first parameter, we set the object reference
 // second parameter, a series of objects where we pass the geometry
 // third parameter, the init object
 // fourth parameter, if we want to loop.
 butterfly = new Animator(but1,
                             [{vertices:but1.vertices, prefix:"fly1"},
                              {vertices:but2.vertices, prefix:"fly2"}],
                             {material:mat, y:0, x:0,z:0,bothsides:true},
                             true);

//using 1.9.4
 //_butterfly.play({prefix:"fly", smooth:true, loop:true, fps:8});

//using 2.0 and higher
 butterfly.play(new AnimationSequence("fly", true, true, 8));

//add object to the scene
 scene.addChild(butterfly);
}

In order to update the animation on screen, place the following code in your onEnterFrame listener:

private function refreshScreen(event:Event):void
{
 //move the position of the butterfly as it animates if needed
 butterfly.rotationY = -10+Math.random()*20;
 butterfly.moveForward(5);

// update the internal animation
 scene.updateTime();

// showtime
 view.render();
}

It is also possible to use the Animator class with any primitive. Here an example using the Cube primitive.
animation

var mat:IMaterial = new BitmapMaterial(myBitmadata, {});
var cube = new Cube({width:350, height:350, depth:350});
var cube2 = new Cube({width:500, height:50, depth:250});
var cube3 = new Cube({width:150, height:450, depth:50});
var cube4 = new Cube({width:650, height:250, depth:550}); 

_anim = new Animator(cube,
                     [{vertices:cube2.vertices, prefix:"cube01"},
                      {vertices:cube3.vertices, prefix:"cube02"},
                      {vertices:cube4.vertices, prefix:"cube03"},
                      {vertices:cube2.vertices, prefix:"cube04"}] ,
                     {material:mat, y:0, x:0, z:0, bothsides:false});
scene.addChild(_anim);

//using 1.9.4
//_anim.play({prefix:"cube", smooth:true, loop:true, fps:.5});

//using 2.0 and higher
_anim.play({new AnimationSequence("cube", true, true, .5));

Adding more sequences
You can add other sequences using the following source+increment syntax – shown here for “run”, “jump” and “land” sequences:

_anim = new Animator(but1,
                     [{vertices:source1.vertices, prefix:"run0"},
                      {vertices:source2.vertices, prefix:"run1"},
                      {vertices:source3.vertices, prefix:"run2"},
                      {vertices:source4.vertices, prefix:"jump0"},
                      {vertices:source5.vertices, prefix:"jump1"},
                      {vertices:source6.vertices, prefix:"land0"},
                      {vertices:source7.vertices, prefix:"land1"}],
                     {material:mat, y:0, x:0, z:0, bothsides:false},
                     true);

You are now able to toggle the animations at runtime using the following:trailer movie John Wick: Chapter 2 2017

_anim.play({new AnimationSequence("run", true, true, .5));
_anim.play({new AnimationSequence("jump", true, true, .5));
_anim.play({new AnimationSequence("land" true, true, .5));

More
The examples shown above are using simple geometry. You can of course do exactly the same with much more complex models.
Like the md2 format and as3 animated format, you can also access many handlers like play, gotoAndPlay, stop etc., but you can also check which prefix is playing, the actual frame number, add listeners onCycle and onSequence – events fired by the animation engine to ease the programming as the motion complexity increases…

Another tutorial will cover these events in depth. More information can be found in the BaseMesh class documentation.