SubGeometries contains one SubGeometry only

Software: Away3D 4.x

polig, Newbie
Posted: 02 April 2012 03:15 PM   Total Posts: 18

I would like to access each of vertexData . (ex. PlaneGeometry )
The PrimitiveBase has subGeometries (Vector.<SubGeometry>)
I am wondering every vertexDatas are in it (each of SubGeometry) , But
subGeometries has one SubGeometry only .

ex.
var geo:PlaneGeometry = new PlaneGeometry();
geo.subGeometries.length——-> 1
geo.subGeometries[0].vertexData——> accessible
geo.subGeometries[1].vertexData——-> not exist
geo.subGeometries[2].vertexData——-> not exist
geo.subGeometries[3].vertexData——-> not exist

Could you explain what is my misunderstanding ?

   

Avatar
Fabrice Closier, Administrator
Posted: 02 April 2012 03:46 PM   Total Posts: 1265   [ # 1 ]

The subgeometries are generated when indices length reaches more than 65565 entries (196695k entries for vertices). Usually automatically handled by the parsers and geometry classes.

You can have more subgeometries. But only when you have a multiple material mesh, as you can have only one material per submesh.

All primitives are generating only one subGeometry.
Keep in mind that some primitive buffers may be fixed.

   

polig, Newbie
Posted: 03 April 2012 04:21 AM   Total Posts: 18   [ # 2 ]

Thank you for your replay .

I would like to create a simple geometry designer as browser application.
I made simple demo by using PV3D.
DEMO

1.Want to place particle dots ( Sprite3D ) each of Vertex position.
2.Move the position like demo

Is it possible by using Away3D4’s primitive geometry ? or need original primitive object ?

   

Avatar
Fabrice Closier, Administrator
Posted: 03 April 2012 07:59 AM   Total Posts: 1265   [ # 3 ]

Yes of course it’s possible, but there is no “dot” primitive.
You’ll have either to use Sprite3D or map a single triangle to represent your dots.

   

polig, Newbie
Posted: 03 April 2012 09:38 AM   Total Posts: 18   [ # 4 ]

Finally I was aware of my misunderstanding.
To get each position datas are

correct:
geo.subGeometries[0].vertexData[i * 3 + 0] //x
geo.subGeometries[0].vertexData[i * 3 + 1] //y
geo.subGeometries[0].vertexData[i * 3 + 2] //z

wrong:
geo.subGeometries[0].vertexData //x,y,z
geo.subGeometries[1].vertexData //x,y,z
geo.subGeometries[2].vertexData //x,y,z

Thank you for supporting me !

   
   
‹‹ BSP collider

X

Away3D Forum

Member Login

Username

Password

Remember_me



X