|
erroneous seth, Newbie
Posted: 18 October 2011 01:18 AM Total Posts: 28
Hello,
I want to load a model (as a Mesh) and, then, get its dimensions (i.e., width) in order for me to construct an appropriate shape for it (a shape of the Away3DPhysics).
For example, if I load a cube model, is it possible to get its dimensions in order to make an AWPBoxShape appropriate for this specific cube model?
Thanks a lot.
|
louis87, Jr. Member
Posted: 18 October 2011 06:49 AM Total Posts: 46
[ # 1 ]
Hi,
Yes, you have the properties maxX,maxY,maxZ and minX,minY,minZ in Mesh
|
erroneous seth, Newbie
Posted: 18 October 2011 11:20 AM Total Posts: 28
[ # 2 ]
Thank you very much, louis87.
Can I ask you one more thing?
I assign names to parts of a model in Blender. Is there a way to get these parts by their name in away3d once the model is loaded?
|
louis87, Jr. Member
Posted: 18 October 2011 11:55 AM Total Posts: 46
[ # 3 ]
I don’t know for sure, but there is a property on AssetEvent that get the name of the mesh.
Sorry for not being more specific (maybe someone know how to do it exactly) and goog luck!
|
erroneous seth, Newbie
Posted: 18 October 2011 01:02 PM Total Posts: 28
[ # 4 ]
First of all, thank you for your replies:-)
Now, as far as my question is concerned… You are right about the name property of the “AssetEvent.asset”.
However, I came across a problem when I’ve tried it out:ohh:
I’ve created two cubes in Blender and named them: “First Cube” and “Second Cube”, respectively.
Then, I’ve tried:
trace(event.asset.name);
and the output was: obj0.
I thought of getting the Mesh and using its SubMeshes, but the Submesh class does not have a “name” property.
|
|
louis87, Jr. Member
Posted: 18 October 2011 01:23 PM Total Posts: 46
[ # 6 ]
I forgot one thing, for know what model you are loading, when you call loadData, in the parameter “ns”, you can put a string… it can be acces later when the model is loaded in AssetEvent (asset.assetNamespace)
|
erroneous seth, Newbie
Posted: 18 October 2011 02:03 PM Total Posts: 28
[ # 7 ]
So, if I understand correctly, the workflow goes something like this:
1. Separately create each model in Blender.
2. Export them as “obj”.
3. Import each of the models in Blender.
4. Use “ogre exporter” to export the scene as “xml”.
5. Create an “xml” reader to load the scene into Away3D.
Have I understood it right? If yes, it is step (5) that scares me a little:cheese:
|
louis87, Jr. Member
Posted: 18 October 2011 02:07 PM Total Posts: 46
[ # 8 ]
Yes, I’m doing in that way right now. I invite to people to contribute more ideas
|
erroneous seth, Newbie
Posted: 18 October 2011 04:17 PM Total Posts: 28
[ # 9 ]
Could I ask one last thing?
Isn’t the Collada format the one most appropriate for “xml” representation of a given scenery?
|