02-06-2015 06:14 PM
Hi everyone ,
I have to to insert a head 3D model in stl format in the scene but when I do it, the result is a white shape without shadows. Like this
Follows the block diagram that I use
I have downloaded many stl model from various sites but the result is ever the same. Only once seems to work: a dragon head model
I read somewhere that stl files don't support materials or textures, but why the dragon is visible and all the others models aren't visible? Are there methods to put material on clear 3D mesh? If so, can anyone show me some examples?
02-06-2015 08:25 PM
02-07-2015 05:39 AM
Then, if the "stl file standard might not be very standard" how can I to import correctly a 3D model in labview? Maybe there is some strange option to export the model from 3D software? The stl files that I downloaded seems to be a clear meshes, without material property. If I want to add it how I have to do?
02-07-2015 06:15 AM
Looks like it got the mesh but not skin on that STL model which looks white... Native LabVIEW 3D controls don't work well with all STL, depending on how the model was created (STL also comes in binary vs ASCII formats which is another limitation in LabVIEW).
02-07-2015 09:25 AM
Yes, it seems to be a "blank" mesh without skin or material. So, how I can add or modify material of any 3D object? I tried to search in the web, but nothing: I have LV 2013 and the examples on the NI site uses blocks that aren't in my version (for example in http://www.ni.com/white-paper/7664/en/ in figure 20 use an "Add Material.vi" that has different input than my "Set Material.vi"). Can anyone explain me how to do it, starting from my block scheme above? Or link me a tutorial?
02-07-2015 12:05 PM
Hi Thoraz,
Would it be possible to post the problem STL file, or a link to it?
It looks like the shape factes may be correctly imported, but not rendered/lighted adequately - possibly a problem with the "Normal" array wired to "Set Mesh Parameters". If the "Normal" vectors are wrong or missing, maybe they can be reconstructed from the facet info ...
By the way, there's a PLY file format which also stores surfaces as sets of facets, though the PLY structure has a more efficient structure (non-redundant verticies) and is more flexible than STL. The free "Meshlab" tool can be helpful when playing with these files.
Cheers.
02-07-2015 01:14 PM
@550nm wrote:
Hi Thoraz,
Would it be possible to post the problem STL file, or a link to it?
It looks like the shape factes may be correctly imported, but not rendered/lighted adequately - possibly a problem with the "Normal" array wired to "Set Mesh Parameters". If the "Normal" vectors are wrong or missing, maybe they can be reconstructed from the facet info ...
By the way, there's a PLY file format which also stores surfaces as sets of facets, though the PLY structure has a more efficient structure (non-redundant verticies) and is more flexible than STL. The free "Meshlab" tool can be helpful when playing with these files.
Cheers.
Ah yes, lighting/shape facets could very well be the problem too - like what 550nm said. You could also use Meshlab (highly recommended, it's a free opensource tool on sourceforge site) to fix those things and even orientation/etc if needed before importing the model in LabVIEW. Other alternative is tools from 3DStudio but that's far from free. If the file is large then you could reduce complexity before importing since that will speed up rendering. Although Meshlab will involve some learning curve, it's definitely worth learning if you work with 3D models.
-BTC
(I'll have to check about PLY format, last I checked LabVIEW couldn't work with it)
02-08-2015 05:57 AM
According to Wikipedia, 'STL files describe only the surface geometry of a three-dimensional object without any representation of color, texture or other common CAD model attributes.'
I would choose another format.
02-08-2015 08:19 PM
Note "Load PLY File", attached.
It won't help the OP because this PLY reader can't read Normal-vector info
(Couldn't find an example PLY file that included the Normal Element...), however...
The normal vector info. in the STL format - when present/correct - does allow the 3D control to render the mesh with lighting/shading, as shown in the original post.
I'm sure it's possible to generate normals - if I recall correctly, it's the cross-product of any two facet edge-vectors - I'm just not sure how to get normal pointed "outward" instead of "inward".
Cheers!
02-09-2015 01:08 AM
Here's an example of two mesh plots - one using Normal vectors, one not.
This Bunny model comes from the Stanford 3D Scanning Repository.
(They had some other cool models, including a couple of dragons...)
All Models supplied are supplied in PLY format (without the Normal vectors).
The point is, Normal-vectors may explain " why the dragon is visible and all the others models aren't visible"
... and the Normal-vectors can be derived, if needed.
Cheers!