PlaneGeometry segments understanding

Software: Away3D 4.x

rusoturisto, Newbie
Posted: 13 August 2013 07:57 PM   Total Posts: 5

Hi every one. I’m trying render pointCloud from kinect device using planeGeometry vertexData. And i’m get stuck with understanding of amount of vertices.

function initPointCloud():void
{
var geometry:PlaneGeometry = new PlaneGeometry(100,100,2,2);
var 
mesh:Mesh = new Mesh(geometry,spriteMaterial);
   
var 
vertices:Vector.<Number> = new Vector.<Number>();
pointCloud.position=0
while(
pointCloud.bytesAvailable>0)
{
var x:Number Number(pointCloud.readUnsignedByte());
+= pointCloud.readUnsignedByte() << 8;
var 
y:Number Number(pointCloud.readUnsignedByte());
+= pointCloud.readUnsignedByte() << 8;
var 
z:Number Number(pointCloud.readUnsignedByte());
+= pointCloud.readUnsignedByte() << 8;
    
vertices.push(x);
vertices.push(y);
vertices.push(z*0.1);
    
}
log
("new vertices length =",vertices.length,"old vertices length =",(mesh.geometry.subGeometries[0] as CompactSubGeometry).vertexData.length);
(
mesh.geometry.subGeometries[0] as CompactSubGeometry).updateData(vertices);
   
pointCloudContainer.addChild(mesh);
   
view.scene.addChild(pointCloudContainer);
   
log("initPointCloud OK");
renderPointCloud();
   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X