LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3D Surface texture

Hi all, I'm trying to create a square surface and apply an image as texture into it. In LV 8.2 I only have a mesh function and when I display it, I get a distorted texture (not flat). I also tried with a box with (X, Y, 0) to make a plane surface but it draws the picture in the upper and lower faces as consequence. What I need to put a picture into a square surface? thanks

0 Kudos
Message 1 of 8
(4,662 Views)

Hello londonnew,

 

Below you'll find the block diagram required to texture a cube object and set it in the 3D picture control in LabVIEW.

If you download the zipped folder and extract the files, you'll find a VI that draws a 3D cube and textures it in very snazzy looking leopard print.

 

Snippet.png

 

There are a lot of property nodes involved, each all necessary in order to produce this output; but if you play around with the solution you'll see the effects that they all have. To learn how to do this, I used the solarsystem.vi example from the NI Example Finder. (Help > Find Examples...)


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 2 of 8
(4,519 Views)

Here I posted a VI to texture the individual faces of a cube, you can simplify to only use one of the faces.

 

http://forums.ni.com/t5/LabVIEW/3D-Picture-Applying-Different-Textures-to-Faces-of-a-Cube/m-p/150050...

0 Kudos
Message 3 of 8
(4,512 Views)

Thank you friends, they are great examples. In the case of the cube, the size of the face depends on the size of the image or the image is expanded depending on the size of the cube? thanks again.

0 Kudos
Message 4 of 8
(4,497 Views)

@londonew wrote:

Thank you friends, they are great examples. In the case of the cube, the size of the face depends on the size of the image or the image is expanded depending on the size of the cube? thanks again.



Hey again londonew!

 

I've tried experimenting with the different settings that come with the texture property node for a 3D object, and I've attached the VI so you can try out your own settings for the objects. As far as I can tell, the image is scaled to suit the face which it is placed on; you could see this in Darin.K's VI as the cube images he used were based on the relatively small user thumbnails. 

 

In the attached example I made the leopard print image very small to see what effects placing it on a large cube would have, and it resulted in the following output:

 

CubeOutput.png

 

I also tested what happened when I used the full resolution image of the print for the texture, and received this output:

 

CubeOutput2.png

 

 

By changing the different texture options on the texture property node, you can see what effect this has on the output of the 3D Picture Indicator.

 

TexturingVI.png

 


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 5 of 8
(4,485 Views)

Thank you Alex, that's just what I feared. So the only possibility to adapt the object and the image is using a mesh or scaling the cube.

 

By other part, I have a challenge with remove.object property that I can not solve. Maybe your knowledgement can be usefull and bring light to this issue:

 

http://forums.ni.com/t5/LabVIEW/3D-Picture-Control-quot-Remove-Object-quot-doesn-t-seem-to-work/td-p...

 

Thanks.

0 Kudos
Message 6 of 8
(4,475 Views)
Just to clarify, are you trying to paste an image on top of a 3D object and have it retain it's size independantly of the size of the cube? I'm still uncertain about what your current issue is with regards to the texturing.
What I've found is that you can define the a 3D transformation on the texture itself, not just the 3D object on which it is placed; this can be done by varying the texture's transformation property. I believe that if you use Darin.K's individual cube face texturing algorithm in conjunction with manipulation of the texture transformation property you might be able to derive some useful texture manipulation functionality that will help you achieve the texture image modulation that you require. The transformation property takes a 4*4 2D Array/Matrix as it's input, so it may take some time to understand just how each one of these cells change the texture's contortion. 
I've deduced that to view the texture normally, the array values should be:
1000
0100
0010
0001
What makes it tricky is that this matrix defines a transformation in 3D space, so it may take some experimentation to understand just how it works. 
If it's simpler, you could adapt the image to the object. LabVIEW gives you the ability to swap 3D textures programmatically, so you could use different sized images for different sets of cube sizes.

Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 7 of 8
(4,463 Views)

Oh no sorry! It is a misunderstanding because the issue with the remove object property is not related with 3D texture. For so I used another post.

 

The goal is to create a point iteratively and keep the points during several iterations. Once desired, I need to remove the objects from the scene and start again the process. Thus, I take the number of iterations (wich corresponds with the number of objects created) and use this number (size array) to remove the objects finally. These objects are removed from the scene but when I count the number of objects with the count.object property I see that they still remain in somewhere althought they are not displayed. As result, the performance slows gradually.

 

This makes sense? thanks in advance.

0 Kudos
Message 8 of 8
(4,456 Views)