LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

find VRML object coordinates

How do I find out where an object is - that is, a VRML object which I imported from a file, using Load VRML File.vi.

By "where it is" I mean what are the min and max X, Y, and Z coordinates of the object.

I realize it could be done by reading in the VRML file as text, and searching through it to find all the vertices - i.e write my own primitive VRML file interpreter. I am hoping for an easier method. Obviously Labview knows this information, because it can plot the object.

A closely related question was posted in 2010, and the asker never got a clear answer.

Thank you.

 

0 Kudos
Message 1 of 7
(4,636 Views)

Can you share what you've tried?

 

I'm not familiar with VRML, but when you use the Load VRML File VI, it outputs a reference to the VRML object. This reference can be wired to a Property node and there are a ton of properties. One of these properties is Billboard.Positions, which outputs an array of XYZ data. Now I don't know what a Billboard is, so this could be useless to you. Have you looked through these properties?

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 7
(4,594 Views)

Thank you James.

What I have tried is looking thorugh the Help files, the Drawing-related palettes, entries in this forum, and elsewhere online for suggestions.

Your suggestion is the best one I have found, but it does not work, at least not for me. I tried your idea, and unfortunately there are 0 elements in the Billboard positions array.   I am not sure what the "Billboard" is. I also tried looking at a few other properties and they too have the value 0.

See attached VI which implements your suggestion. Also included: tetrahedron.wrl.txt, as a VRML file to load when prompted. (Remove the ".txt" from the filename before running. I added ".txt" because this Forum would not let me upload it with the suffix .wrl.) This VI runs fine but it does not tell me where the object is.

 

Download All
0 Kudos
Message 3 of 7
(4,579 Views)

If I understand correctly, VRML is defined in polar coordinates. (http://www.sv.vt.edu/classes/vrml/vrml_primer_index.html) Are you sure you can get that information out to operate on it?

 

I've found some information about unsupported VRML features in LabVIEW.  Do you know if this would fall into one of these functions?  http://digital.ni.com/public.nsf/allkb/94E716A426FAD46B862575CA005747E0

 

Off the top of my head, I don't know how you would perform this with predefined LabVIEW functions, and it appears the supported features are limited.  As you've said, the best method might be to manually code the method you mentioned above.

Chris
Message 4 of 7
(4,544 Views)

Thank you, Chris, for your help.  I was able to open the first link in your post after removing the ")" at the end.

 

VRML does not use spherical coordinates. For example, the link you provided shows that: Translations are expressed using Cartesian coordinates. The location of a light, and the location and orientation of a camera, are expressed using Cartesian coordinates.  Rotations are accomplished using the axis-angle formalism (also known as the helical angle approach), in which the axis of rotation is specified using Cartesian coordinates. Scaling factors are specified in Cartesian coordinates.

 

The second site you gave lists VRML features not supported by LV.  These features are ways of modifying or enhancing VRML objects, and of doing fancy thinigs inside a VRML world.  I think they do not directly relate to my question, which is how do I find out from Labview the location and extent of a VRML object that I have loaded.  My VRML files, including the example I posted, are simple and do not use any of the unsupported features listed. I avoid elongated polygons.

 

By the way, I see that your icon shows you heading a soccer ball.  I am using LV to create animations of head motion during soccer heading.  I use a VRML file for a skull, and data from a 3-axis accelerometer worn by the subject.  The VRML file for the skull has 3308 vertices and 3779 polygons.

 

Bill

0 Kudos
Message 5 of 7
(4,523 Views)

Unfortunately, besides the workaround you suggested in one of your previous posts, I'm not sure another solution exists.

Chris
Message 6 of 7
(4,486 Views)

OK. Thank you Chris.

0 Kudos
Message 7 of 7
(4,472 Views)