Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mapping movie on to sphere



	Wes,

Thanks a ton.  That is a simple and elegant solution.

Being an OpenGL novice I did not even realize scaling the texture was an option and that one difference between power of 2 textures and rectangle textures was 0 to 1, vs 0 to width and 0 to height texture values.

I now have some view and matrix issues that I was able to sort out, but reloading the identity matrix for all textures that I do not change the scale on. I change the texture within glPushMatrix and glPopMatrix so I was surprised I had to reset them for my other textures. Am I missing something here. I of course had to reset my matrix mode to GL_MODELVIEW.

Thanks again,
Matt

On May 28, 2007, at 8:47 PM, Wesley Smith wrote:

By saying it only maps power of 3 textures do you mean thte texture
coordinates only range from [0, 1] in both directions?  If that's the
case, the simple solution is to scale your texture matrix by the
dimensions of the rectangular texture.

//bind texture
glMatrixMode(GL_TEXTURE)
glScalef(texWidth, texHeight, 1);

//draw sphere

wes

On 5/28/07, Matthew Veenstra <email@hidden> wrote:
 Hello,

I am trying to use a modern Mac OS X approach to texture map frames of a QT
movie onto a gluSphere.


Here is what I do.

- I grab the frames with QTVisualContextCopyImageForTime
- I then create and setup the OpenGL texture
with CVOpenGLTextureCacheCreateTextureFromImage
- I can then happily map to GL_QUADS and such but I cannot then map to a glu
quadratic (gluSphere)


It seems gluSphere only lets us map a power of 2
texture. CVOpenGLTextureCacheCreateTextureFromImage
returns a non power of 2 texture. Does anyone know another way to get
texture data from QTVisualContextCopyImageForTime for
glTexture2D or such. Would I have to go back to a GWorld to try and do this
and create a power of 2 texture?


Is there a way to use gluSphere with a non power of 2 texture. I am not
sure I know my math well enough to create my own sphere and handle my own
mapping.


Any other ideas?

Matt Veenstra
tribalmedia.com


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/wesley.hoke% 40gmail.com


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Mac-opengl mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden
References: 
 >Mapping movie on to sphere (From: Matthew Veenstra <email@hidden>)
 >Re: Mapping movie on to sphere (From: "Wesley Smith" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.