Robert, First, I tried resizing my video to 256x256. And it worked!!! Then I tried projecting a NPOT video, but I called setResizeNonPowerOfTwoHint(false). And that worked too!!!
I don't completely understand why the resizing was causing my movie to appear gray. Maybe because the scaleImage() call couldn't keep up with the frame rate? Anyway, thanks so much for your help! You are the man. Andrew -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: Thursday, July 12, 2007 8:57 AM To: osg users Subject: Re: [osg-users] ImageStream Projection Hi Andrew, If you use Texture2D the OSG will resize to a power of two unless you switch off the resize non power of two texture hint. From include/osg/Texture: /** Sets whether to force the texture to resize images that have dimensions * that are not a power of two. If enabled, NPOT images will be resized, * whether or not NPOT textures are supported by the hardware. If disabled, * NPOT images will not be resized if supported by hardware. */ inline void setResizeNonPowerOfTwoHint(bool flag) { _resizeNonPowerOfTwoHint = flag; } This shouldn't affect the image being grey though. Also try making sure you have mip mapping off. Robert. On 7/12/07, Weitz, Andrew C. <[EMAIL PROTECTED]> wrote: > Hi Robert, > > I can see the video on the texture rectangle when I run osgMovie. I > just can't see it in my own program that uses a TexGenNode. > > I set the notify level to DEBUG, but I don't see anything out of the > ordinary. In fact, it looks like the movie is playing: > > Quicktime initialized successfully > QT-ImageStream: loading quicktime movie from C:\data\test\circle.avi > MovieData :: opening movie 'C:\data\test\circle.avi' > movietime: 0 rate: 0 state 1 playing: 0 done 0 1/1 > new cmd: 1 > applying loop mode 1 > movietime: 0.0166667 rate: 1 state 0 playing: 1 done 0 1/1 > movietime: 0.0333333 rate: 1 state 0 playing: 1 done 0 1/1 > Scaling image 'C:\data\test\circle.avi' from (320,240) to (256,256) > movietime: 0.05 rate: 1 state 0 playing: 1 done 0 1/1 > Scaling image 'C:\data\test\circle.avi' from (320,240) to (256,256) > movietime: 0.0666667 rate: 1 state 0 playing: 1 done 0 1/1 > Scaling image 'C:\data\test\circle.avi' from (320,240) to (256,256) > movietime: 0.0833333 rate: 1 state 0 playing: 1 done 0 1/1 > > The "Scaling image" and "movietime" lines keep repeating while my movie > plays. I have no idea why I can't see it! > > Andrew > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Robert > Osfield > Sent: Thursday, July 12, 2007 8:38 AM > To: osg users > Subject: Re: [osg-users] ImageStream Projection > > Hi Andrew, > > Are you able to see the video OK with osgmovie? > > Something else you might want to try is enabling debug info via the > env var OSG_NOTIFY_LEVEL, setting it to DEBUG. > > > Robert. > > On 7/12/07, Weitz, Andrew C. <[EMAIL PROTECTED]> wrote: > > Hi Robert, > > > > My program does work with a straight Image. For example, I can > project > > a JPG or GIF onto my geometry and it looks great. But when I replace > > the Image with an ImageStream, all I get is a gray rectangle. See > > attached image. > > > > Thanks for your help. > > > > Andrew > > > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of Robert > > Osfield > > Sent: Thursday, July 12, 2007 8:26 AM > > To: osg users > > Subject: Re: [osg-users] ImageStream Projection > > > > Hi Andrew, > > > > It shouldn't make any difference whether the data is an ImageStream or > > an straight Image. Try getting what you are doing working with a > > normal image and then see how you get on. > > > > Also have a look at example that use TexGenNode such as osgspotlight. > > > > Robert. > > > > On 7/12/07, Weitz, Andrew C. <[EMAIL PROTECTED]> wrote: > > > Robert, > > > > > > I am not using a TextureRectangle or specifying any texture > > coordinates. > > > That is because I'm using a TexGenNode. I use the following code to > > > specify the projection plane, which works when projecting an Image: > > > > > > tex_gen_node->getTexGen()-> > > > setPlanesFromMatrix( osg::Matrixd::ortho2D( upper_left_x, > > > lower_right_x, > > > lower_right_y, > > > upper_left_y ) * > > > osg::Matrix::translate( 1.0, 1.0, 1.0 ) * > > > osg::Matrix::scale( 0.5, 0.5, 0.5 )); > > > > > > Will this code have to change to accommodate the ImageStream? Or > does > > > my problem lie elsewhere? > > > > > > Thanks! > > > Andrew > > > > > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED] On Behalf Of Robert > > > Osfield > > > Sent: Thursday, July 12, 2007 1:30 AM > > > To: osg users > > > Subject: Re: [osg-users] ImageStream Projection > > > > > > HI Andrew, > > > > > > Most likely its simply that your tex coords are off. If you are > using > > > a TextureRectangle then the tex coords go from 0,0 to width,height > > > rather than 0,0 to 1,1 like on normal textures. > > > > > > Robert. > > > > > > On 7/12/07, Weitz, Andrew C. <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > > > > > My goal is to project an ImageStream onto some geometry. I'm > using > > > the > > > > QuickTime plugin to read an AVI file as an ImageStream. > > > > > > > > I can successfully project an Image onto my geometry by using a > > > > TexGenNode and TexEnv. My code for projecting an ImageStream is > > > > identical, except that I cast the Image to an ImageStream and then > > > call > > > > play(). The problem is that I never see the movie; instead, I see > a > > > > solid gray image projected where the movie should be. > > > > > > > > Is it possible to do what I'm attempting? > > > > > > > > Thanks, > > > > Andrew > > > > _______________________________________________ > > > > osg-users mailing list > > > > osg-users@openscenegraph.net > > > > http://openscenegraph.net/mailman/listinfo/osg-users > > > > http://www.openscenegraph.org/ > > > > > > > _______________________________________________ > > > osg-users mailing list > > > osg-users@openscenegraph.net > > > http://openscenegraph.net/mailman/listinfo/osg-users > > > http://www.openscenegraph.org/ > > > _______________________________________________ > > > osg-users mailing list > > > osg-users@openscenegraph.net > > > http://openscenegraph.net/mailman/listinfo/osg-users > > > http://www.openscenegraph.org/ > > > > > _______________________________________________ > > osg-users mailing list > > osg-users@openscenegraph.net > > http://openscenegraph.net/mailman/listinfo/osg-users > > http://www.openscenegraph.org/ > > > > _______________________________________________ > > osg-users mailing list > > osg-users@openscenegraph.net > > http://openscenegraph.net/mailman/listinfo/osg-users > > http://www.openscenegraph.org/ > > > > > _______________________________________________ > osg-users mailing list > osg-users@openscenegraph.net > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > _______________________________________________ > osg-users mailing list > osg-users@openscenegraph.net > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/ _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/