LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3d texture animate

Hi,

I'm using the new 3d picture control in  Labview 8.2. I'm using it to create a program/game that can move 2D sprites about the screen whilst getting the benefits of the open-gl accelerated render window. Applying png textures to quads works really well and gives good performance.

I wonder if there is a way to dynamically change the texture assigned to a particular object so that it appears animated? E.g. swap from texture_A.png to texture_B.png etc as the object moves about? So far I haven't been successful  - I get 'invalid object' errors. My other idea is to create a stack of quads, and move the correct frame to the top of the pile as necessary. Any ideas on the CPU overhead  this would incur?

More far fetched, but on a similar theme, could full motion video be sent to the external render window?

Thanks for any help/ideas!

Pete
0 Kudos
Message 1 of 5
(3,593 Views)
Hi Pete,

I'm including a simple VI that will swap between two textures.  I have a feeling the problem you are having is that you aren't hanging onto your texture refs after you assign them to a scene object.  Basically when you wire into Set Texture, if you dont wire through the back side of that invoke node, we automatically take care of closing that reference for you.  We did this to avoid making users drop down a lot of close reference VI's when using the 3d Picture Control (You'd need one after every Set Geometry, Add Object, Set Texture etc..)

--Shawn M
0 Kudos
Message 2 of 5
(3,558 Views)

More far fetched, but on a similar theme, could full motion video be sent to the external render window?

Yes!  At NIWeek, I saw an example of someone who did that with their webcam.  Essentially they just captured live frames and updated a quad with texture data derived from the picture generated by the camera.  I apologize, but I don't remember thier name nor do I have a copy of thier VIs.

So, assuming you can capture frames from your video source, be it a file or camera, and format the picture data properly, you should be able to do this pretty easily.

 

 

 

0 Kudos
Message 3 of 5
(3,553 Views)
Thanks to both the above posts, much appreciated and useful.

I've managed to get textures updating as shown in the example vi - seems like there isn't a particularly big overhead to doing this either.

Also, I liked the sound of the webcam to a quad, seemed like a good timewaste/test! Attached is a hacky version I've put together

I had to do a bit of searching to work out how to convert from an imaq complex image into a pixmap to use as a texture - the current way doesn't seem particularly optimal but works for both webcam and video. Might be useful for someone..

Cheers,

Pete


Message Edited by Pete Culmer on 12-20-2007 05:40 AM
0 Kudos
Message 4 of 5
(3,516 Views)

Hi friends, I think this post is a bit old but still usefull. About it, I have one question. How is possible to see transparent the webcam image? I'd like the image be applied to the cube but with no monocolor (not the texture of the cube). That is, the webcam to be applied to the cube faces but with its real color. Thanks if anybody can help me on this.

0 Kudos
Message 5 of 5
(2,998 Views)