Modify figure like Cloth or hair

Software: Away3D 4.x

polig, Newbie
Posted: 06 June 2015 12:59 AM   Total Posts: 18

I am troubling this problem for a few years.
I want to modify figure of geometry of hairs or skirts, in accordance with the movements of body.

I could find the method to modify figure by using fromVectors .

//create bitmap texture
var bmd:BitmapData = new texture().bitmapData;
var 
mat:TextureMaterial = new TextureMaterial( new BitmapTexturebmd ) );

//add mesh
var mesh:Mesh = new Mesh( new PlaneGeometry400400 ), mat );
scene.addChildmesh );
mesh.rotationX = -90;

//refere subGeometry
var sub:ISubGeometry mesh.geometry.subGeometries[0];
   
sub.autoDeriveVertexNormals true;
sub.autoDeriveVertexTangents true;

//get vertex datas   
var vx:Vector.<Number> = sub.vertexData;
var 
vxp:Vector.<Number> = sub.vertexPositionData;
var 
uvs:Vector.<Number> = sub.UVData;
var 
nml:Vector.<Number> = sub.vertexNormalData;
var 
tan:Vector.<Number> = sub.vertexTangentData;

//modify figure like waving by wind
vxp[ 1 1] 50;

//update vertex
sub.fromVectors(vxpuvsnmltan ); //uv and specular will be broken
//sub.fromVectors( vxp, null, null, null ); //uv will be broken 

the figure is updated as desired.
But If i choose TextureMaterial , UV appearance will be broken.
(Single pattern color like ColorMaterial , no problem.)

By the way, until Away3D 4.0 , the updateVertexData method could modify figure without uv appearance broken. (but shadow was incorrect.)

Is it difficult to modify figure with correct uv appearance ?

   

polig, Newbie
Posted: 19 June 2015 04:09 AM   Total Posts: 18   [ # 1 ]

Finally I could realize by myself.
NURBSGeometry is the answer.

tks!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X