LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VRML Vertices from LabVIEW 3D SceneObject

Hello,
 
I wish to be able to load in a VRML file and find its vertex array to be able to scale it appropratiely within a 3D scene. I' having no joy using the code in this post http://forums.ni.com/ni/board/message?board.id=170&message.id=365595&query.id=6458#M365595 and I need a resolution to this quickly.
 
The zip file contains my VRML file, and my code to then convert it from a SceneObject to a SceneMesh which should output the Vertices. But it just errors out.
 
Cheers
 
Tom
Message 1 of 4
(3,278 Views)

Hi Tom,

I believe the problem is due to the references and complexity of the model file.

In the example code from your link the application first breaks the much simpler file down into objects / shapes.  This file only contains 5 shapes.  It is the reference to the shape that is passed to the "to more specific class" node.  An individual shape can be converted to a Mesh, and the Vertex Array then extracted.

 

The reason that your code does not function is you are not passing in a reference to a specific shape, but to the specific entire object.  LabVIEW cannot convert this to a mesh.

Playing around with the file it contains more than 4000 separate shapes and LabVIEW does not know which to convert to a mesh unless you give it a more specific reference.

 

My suggestion is to get the mesh dimensions for a single shape, as you know how big each shape is you can scale the entire model based on these dimensions.

The most efficient way to locate a shape in a file of this size is to search for it.  Unfortunately the shapes in the file did not contain defined names, so I added a defined name to the first shape in the file in order to get the code to function correctly.

 

Line 10 in the file contained: "Shape {"

I replaced this with: "DEF LVtest Shape {"

 

This allows me to then search for that shape in LabVIEW using the attached example code.

 

Have a play around and let me know if this resolves your issue.

 

Best regards,

 

John

 

 

------
John.P | Certified LabVIEW Architect | NI Alliance Member
Message 2 of 4
(3,238 Views)

John, 

 

Thankyou very much for that. I worked around the problem by creating a single vertex in Google Sktech up of the same (known) length of the the craft and then read back that single object from the exported VRML file using your file change and it worked.

 

Cheers again,

 

Tom. 

0 Kudos
Message 3 of 4
(3,225 Views)

Hi I am loading vrml files and  it runs the model very slow in 3D. Could you give some advice to run it faster?

 

Cheers,

Ronie

0 Kudos
Message 4 of 4
(2,599 Views)