PDA

View Full Version : I want to rescale image...



Dorae2
05-15-2002, 12:02 AM
Hi http://www.opengl.org/discussion_boards/ubb/smile.gif; I am high school student in Asia...

(So I can't speak English well)

I'm making small game for training.

But I have big trouble now...

I want to use 300 * 200 sized image to

texture.

Some people advised me to use 'gluScaleImage'

But if I use this function,I always get

strange image...

Can I use gluScaleImage to rescale 300*200

sized image to 256*256 sized image?

I need your help http://www.opengl.org/discussion_boards/ubb/frown.gif...

marcus256
05-15-2002, 01:54 AM
I haven't tried your exact parameters, but it should be possible.

Are you using the correcte format and type settings?

format = GL_RGB (or GL_RGBA)
typeIn = GL_UNSIGNED_BYTE
typeOut = GL_UNSIGNED_BYTE

Dorae2
05-15-2002, 10:13 PM
Maybe...

I use correct parameters... http://www.opengl.org/discussion_boards/ubb/frown.gif...

marcus256
05-15-2002, 11:00 PM
Have you tried using gluBuild2DMipmaps?

It does the scaling automatically for you (the texture does not have to have a size that is a power of two).

Gavin
05-17-2002, 12:34 AM
So what do you mean by 'strange' image?

V-man
05-17-2002, 05:19 AM
Originally posted by marcus256:
I haven't tried your exact parameters, but it should be possible.

Are you using the correcte format and type settings?

format = GL_RGB (or GL_RGBA)
typeIn = GL_UNSIGNED_BYTE
typeOut = GL_UNSIGNED_BYTE


Also
glPixelStorei(GL_UNPACK_ALIGNMENT, ?);
glPixelStorei(GL_PACK_ALIGNMENT, ?);

V-man

Dorae2
05-17-2002, 08:38 PM
Hmm...;

I got 'broken' image...;