LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I add a 2D image to a 3D picture control?

Can a 2D image such as data obtained from a .jpg or .png file be added as an object to a 3D scene? Thanks for your time in advance.

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

hi Donovan@LSI,

 

you can add a .jpg as texture to an 3d object:

 

https://decibel.ni.com/content/docs/DOC-4765

 

moreover, this examples shows how to create an hight-field from a .jpg or .png based on the image's intensities

 

 

 

Regards,
Alex

 

 

0 Kudos
Message 2 of 7
(4,084 Views)

Yes, but textures wrap all around the object. I want only one (front surface). Is that possible to limit the wrap of the texture?

0 Kudos
Message 3 of 7
(4,078 Views)

Hi Donovan,

 

I think what you're looking for is to set the texture "As a decal"- this option (refer to the SceneTexture:ApplyMode property) will cause the texture to be applied to one surface of the object.

 

If you're looking to add a flat 2D plane to the scene control, you'll probably want to use a Quads mesh.  This example is pretty good and makes extensive use of 2D objects in a 3D scene:

 

Community Example: LabVIEW 3D Space Explorer Game

https://decibel.ni.com/content/docs/DOC-3372

 

Hope that helps!

 

 

Tom L.
0 Kudos
Message 4 of 7
(4,067 Views)

Donovan,

 

haven't investigated Outlaw's link which may contain the solution you are after, however if that doesn't fit the bill, I have some code that displays an image as a textured quad scaled such that it is a pixel perfect reproduction of the source image.

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

Thank you for the replies, all. What Outlaw mentioned seems to fit my needs, but ToeCutter, I would be interested in seeing the code you mentioned, too.

0 Kudos
Message 6 of 7
(4,032 Views)

It look slike I spoke too soon. The method Outlaw mentioned did nto work for me. It applies the image to all surfaces of a cube. I found the answer here... http://forums.ni.com/t5/LabVIEW/3D-Picture-Applying-Different-Textures-to-Faces-of-a-Cube/td-p/14989....

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