From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

load vrml

I am desperately trying to load a vrml file into a 3d picture control

I have downloaded the 3d picture control toolkid evaluation software and it works perfectly
with geometries that were created in the vi itself, but when it comes to importing vrml (*.wrl)
files, all I get is a black picture control window.

I am aware that only vrml97 is working, but when I try wrl files from forums, where there is stated
that they work (only textures cannot be applied), again I get a black window.

I also fixed my load VRML File.vi according to
http://zone.ni.com/reference/en-XX/help/371361B-01/lvhowto/light_3d_scene/
but still I get a black window.

So I suppose it all comes down to a defective 'Load VRML File.vi'
Therefore I would be very thankfull if anyone could supply me with that file
where 'wrl' and / or 'vrml import' (both see attachment) is working.

It might be interesting to know that importing stl (ascii-STL-Files) results in the same problem.
(but I havent tried very hard)

Thanks in advance!!

I am using Labview 8.2 Student Edition

My Email is dji-unit@gmx.net
0 Kudos
Message 1 of 12
(7,527 Views)

Hello Heinz81

Have you succeeded in importing and viewing your external 3d file? I have your same problem and I don't seem to be able to solve it.

Thank you
gigiozzi

0 Kudos
Message 2 of 12
(7,279 Views)
I just started poking at this myself.  The "vrml.vi" inside Heinz81's attachment works perfectly for me.

Perhaps it is a matter of inadequate 3D acceleration hardware, or outdated drivers?
0 Kudos
Message 3 of 12
(7,264 Views)
Hello!

First of all, I'd like to thank for answering!

Second I have unfortunately not jet been able to successfully run the vi in my initial attachment.
(havent tried it anymore, just a minute ago and it did not work)

You could be right, kehander, I'm using an outdated driver(84.21), because the driver menu for versions in exceedance of ~ 89.00
"sucks" in my opinion. But I never had trouble with that in any other ways.

The attachment contains a screenshot of my graphics adapter specs. Maybe on gigiozzi's Machine it looks similar.
It would be intersting to know about your specs, gigiozzi. Maybe updating the driver is not such a long shot/bad idea after all.
Or maybe it proves that your specs are different, but still it is not working, so this issue is no cause for the error.

But actually, I dont think this happens due to the graphicsadapter and its driver, to proove that, I also attached (in the zip)
a VI named 'solarsystem_edit.vi' that should be working when '3d picture control toolkid evaluation software' is installed
and repaired according to the link below. It can also be downloaded from national instruments
somewhere if it doesnt work as a kind of "standalone" vi.
This attached VI (solarsystem_edit.vi) completely works for me.

So I would figure the cause is to be looked for when importing geometries.

Therfore I'd really be thankfull if anyone who can run the above attached VI's,
could post his/her 'Load VRML File.vi' - File.

It is located under:
'Drive:\InstallDir\National Instruments\LabVIEW 8.2\vi.lib\picture\3D Picture Control\File Loading'

Thanks for that or any usefull input in advance!!

P.S.: The Link I posted above in my initial Message was wrong, so here goes the correct one:
http://digital.ni.com/public.nsf/allkb/1D7CDB5D8E834C3B862571E4005FBDD3?OpenDocument

0 Kudos
Message 4 of 12
(7,185 Views)
I'm having the same issue when writing my labView code. I've tried importing several VRML files, and can't seem to get them to show up. For some, I can see a faint outline of the model, and with one model a vertex or two is visible. My problem seems like a lighting issue. I can't figure out how to get it to light up though, and it could be the same problem you're having. I hope somebody has a solution...
 
-Daniel-
0 Kudos
Message 5 of 12
(7,149 Views)

@ech0_matrix wrote:
I'm having the same issue when writing my labView code. I've tried importing several VRML files, and can't seem to get them to show up. For some, I can see a faint outline of the model, and with one model a vertex or two is visible. My problem seems like a lighting issue. I can't figure out how to get it to light up though, and it could be the same problem you're having. I hope somebody has a solution...


I'm pretty sure that's just a matter of applying a texture to the file you import (or failing that, adding a "light" to the rendered image) - otherwise the model will indeed be invisible.  I think Heinz81's VRML.vi program (in the above attachment) does that if you need an example.
0 Kudos
Message 6 of 12
(7,138 Views)
Hi, Heinz81.

I'm trying to do exactly the same. I need to load in LabView a robot arm model created in SolidEdge, and then, control its joints directly from LabView and display the movement in the control panel.

I can download "3D Picture Control Evaluation Software" from

http://zone.ni.com/devzone/cda/tut/p/id/4411

but I think it's for older versions of LabView. It includes some VIs that aren't in the main package of LabView 8.2, like "Draw Scene.vi", "Render scene.vi" and more... Even, there are some examples included in this package, like "Robot arm" and "Animate Object", but the procedure for displaying the 3D image is different from that one used in "Solar system.vi" (belonging to newer version of LabView). I don't understand this difference.

What I have to do is something very similar to example "Robot arm", but I have to get the model from SolidEdge, instead of creating it in LabView. But I can't manage for displaying any image in LabView loading a VRML file.

Could somebody help me?

Regards,
Francisco
0 Kudos
Message 7 of 12
(7,086 Views)
Hi, people, again.

I'm desperately trying to find out a solution for this slippery problem. Well, I didn't succeed yet, but I found maybe the origin (or one of them) of the problem. "Load VRML file.vi" don't seem to recognize decimal units in VRML files. For example, I create very simple VRML model in a program called Flux Studio v2.1. It is a cube of dimensions 1x1x1, and with integer values in the color parameters (ambientIntensity:1; shininess:1; diffuseColor: 1 0 0). You can edit this model in the VRMLPad software, and change every parameter you want. With these settings, the cube results red. I display it in LabView without problems, using just "Load VRML.vi" wired to a "3D Picture Control". If you add a While Loop, and set the camera controller to "Spherical", you can rotate the cube and you notice that it appears unlighted, totally dark red without changes of shade. If you add a light in the LabView program, it also works, and you can see the red cube lighted.

Well, now, if you change any parameter to decimal value on this file in the VRMLPad, for example, set dimensions to 1.5x1x1, you will have again a red cube of 1x1x1 displayed in the 3D Picture Control. If you change dimensions to 2x1x1, you will obtain the correct geometry in the 3D Picture Control, a 2x1x1 cube. So, if dimensions are 0.***, like many VRML files, they are read like 0 by "Load VRML file.vi", and then nothing appears. The same happens with color parameters (if they all are 0.***, you will have 0 values, that in most cases, depending of combination, they will correspond to BLACK colour).

This was tested on LabView 8.2.

I tried also with LabView 8.5, but in this case "Load VRML file.vi" isn't able to load any VRML file: always appear an error ("error 0"). I emailed to NI support and they told me there is a CAR ("Corrective Action Request") related with this problem, and that it has already solution. They told me I have to change indexes color in the VRML file itself, but they didn't give me further details.

Do you have any news about the problem?

Regards,
Francisco
0 Kudos
Message 8 of 12
(6,983 Views)
Hi Porras,

thanks for your input! I indeed found it usefull. I think you're right about those decimals.

In the 'test.wrl' to be found in my initial attachment, I only changed one of the values behind 'diffuseColor'
from f.e. '0.999999' to '1.000000' and le voila, the part showed up.
Maybe this refers to:

<citation>
 They told me I have to change indexes color in the VRML file itself, but they didn't give me further details.
</citation>

But this way the max. amount of colors that can be displayed is 8 (2^3).

I tried to chase down the problem through the vi's the 'vrml.vi', in the above attachement, uses.
Somewhere those decimals got to get lost along the way due to some datatype that is set wrong
(integer instead of long or something), but I couldnt find anything.

So I will report this to an NI-engineer I'm in contact with in this matter.
At least we now know its not due to graphics adapter drivers, etc.

To matters of that bugfixlist (CAR) you mentionend:
http://zone.ni.com/devzone/cda/tut/p/id/6210
or
http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/b00d8c1c18497a878625731c006fc5b6/$FILE/windows_readme.html
or
http://zone.ni.com/devzone/cda/tut/p/id/6448

As far as I understand that list, it lists known bugs that you don't have to "suffer" from, if you're using
Labview 8.5. So there is nothing "to do" with that list but read it, and be happy that you have 8.5 if u have it.

Anyway I think this Item doesn't apply here:
- 47F9DJIQ     Load VRML File VI does not work properly in an executable in LabVIEW 8.2
  (Applies for executables (*.exe) compiled by 'application builder' (or what it was named))

This could be more to the point:
- 43L7O5C1     load VRML file does not load *.wrl file with color information
  (But I don't know wheater it is just the color, as the geometry
  doesnt seem right as well (cylinder in 'test.wrl' does not appear as a cylinder, more like a cross))
  (You can check what the part looks like when using f.e. cortona vrml plug in for firefox.)

 
So all in all evidence is hardening that 'Load VRML File.vi' or one or more of its called vi's has errors.
The question remaining is how easily this can be fixed with LV 8.2. I'm hoping the NI-Engineer can answer that.

I am using Labview 8.2.0 Student Edition

I'm gonna state any progress with this issue here.

Again thanks for narrowing the error causes.

Heinz81
0 Kudos
Message 9 of 12
(6,918 Views)

Hi all again.

 

My problem still remains. I've upgraded to LabView 8.6, but "Load VRML file" seem to have the same problem.

 

But there is a new and recent tutorial where it is said it is possible:

 

http://zone.ni.com/devzone/cda/tut/p/id/3170

 

(in the section "Importing a 3D model from file")

 

Could you help me?

 

Thanks in advance.

 

Regards,

Francisco

0 Kudos
Message 10 of 12
(6,404 Views)