10-07-2013 02:27 PM
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.
10-07-2013 02:48 PM
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
10-07-2013 02:54 PM
Yes, but textures wrap all around the object. I want only one (front surface). Is that possible to limit the wrap of the texture?
10-07-2013 04:02 PM
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!
10-07-2013 05:28 PM
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.
10-08-2013 08:54 AM
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.
10-08-2013 10:09 AM
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....