modifying the texture matrix + using gluSphere

  • Follow


Hello!

I have modified my texture matrix by doing this:

  glMatrixMode(GL_TEXTURE);
  glScaled(double(w1)/double(w2),double(h1)/double(h2),1.0);
  glTranslated(0.0,-1.0,0);
  glMatrixMode(GL_MODELVIEW);


where h1, h2, w1 and w2 denotes the height, power of two height, width, power of two width of a texture respectively.

Now, when I output the texture on a quad by using the texture coordinates (0,0), (1,0), (1,1), (0,1), it is showing correctly.

However, I would not done this texture manipulation thing if it wasnt for the fact that gluSphere wants to use the mentioned texture
coordinates.

So, now when I try to use gluSphere with this setup, it looks terrible. It is not possible to see what it is supposed to look like.
Symptoms: I get an almost single colored ball, but the color is one of the textures colors actually.

So, what did I do wrong?

best regards
/Anders


0
Reply Anders 9/29/2004 2:51:20 PM

Anders Lind�n wrote:
> Hello!
> 
> I have modified my texture matrix by doing this:
> 
>   glMatrixMode(GL_TEXTURE);
>   glScaled(double(w1)/double(w2),double(h1)/double(h2),1.0);
>   glTranslated(0.0,-1.0,0);
>   glMatrixMode(GL_MODELVIEW);
> 
> now when I try to use gluSphere with this setup, it looks terrible.
> 
> So, what did I do wrong?
> 

Did you forget a glLoadIdentity() somewhere...?


-- 
<\___/>          For email, remove my socks.
/ O O \
\_____/  FTB.    The Cheat is not dead!


0
Reply fungus 9/29/2004 3:47:48 PM


Hello fungus! Thanks for your fast reply!

I thought the texture matrix was identity in the beginning of my code execution.
Isnt that right?


best regards
/Anders

"fungus" <openglMY@SOCKSartlum.com> wrote in message news:FOA6d.122$4W6.64@news.ono.com...
> Anders Lind�n wrote:
> > Hello!
> >
> > I have modified my texture matrix by doing this:
> >
> >   glMatrixMode(GL_TEXTURE);
> >   glScaled(double(w1)/double(w2),double(h1)/double(h2),1.0);
> >   glTranslated(0.0,-1.0,0);
> >   glMatrixMode(GL_MODELVIEW);
> >
> > now when I try to use gluSphere with this setup, it looks terrible.
> >
> > So, what did I do wrong?
> >
>
> Did you forget a glLoadIdentity() somewhere...?
>
>
> --
> <\___/>          For email, remove my socks.
> / O O \
> \_____/  FTB.    The Cheat is not dead!
>
>


0
Reply Anders 9/29/2004 4:07:59 PM

And... dont forget that it worked with my quad :)

/A


"fungus" <openglMY@SOCKSartlum.com> wrote in message news:FOA6d.122$4W6.64@news.ono.com...
> Anders Lind�n wrote:
> > Hello!
> >
> > I have modified my texture matrix by doing this:
> >
> >   glMatrixMode(GL_TEXTURE);
> >   glScaled(double(w1)/double(w2),double(h1)/double(h2),1.0);
> >   glTranslated(0.0,-1.0,0);
> >   glMatrixMode(GL_MODELVIEW);
> >
> > now when I try to use gluSphere with this setup, it looks terrible.
> >
> > So, what did I do wrong?
> >
>
> Did you forget a glLoadIdentity() somewhere...?
>
>
> --
> <\___/>          For email, remove my socks.
> / O O \
> \_____/  FTB.    The Cheat is not dead!
>
>


0
Reply Anders 9/29/2004 4:08:23 PM

Anders Lind�n wrote:
> Hello fungus! Thanks for your fast reply!
> 
> I thought the texture matrix was identity in the beginning of my code execution.
> Isnt that right?
> 

Yes but maybe you were doing the scale every pass
or something.


-- 
<\___/>          For email, remove my socks.
/ O O \
\_____/  FTB.    The Cheat is not dead!


0
Reply fungus 9/29/2004 4:27:49 PM

hm, doesnt seem to be the case, I have put a Beep(2000,20); near that code and it only beeps once.
Also consider that drawing a quad with the texture worked as supposed.


/Anders

"fungus" <openglMY@SOCKSartlum.com> wrote in message news:9oB6d.162$4W6.124@news.ono.com...
> Anders Lind�n wrote:
> > Hello fungus! Thanks for your fast reply!
> >
> > I thought the texture matrix was identity in the beginning of my code execution.
> > Isnt that right?
> >
>
> Yes but maybe you were doing the scale every pass
> or something.
>
>
> --
> <\___/>          For email, remove my socks.
> / O O \
> \_____/  FTB.    The Cheat is not dead!
>
>


0
Reply Anders 9/29/2004 4:55:29 PM

Seems like I forgot a call to this:

gluQuadricTexture(q, GL_TRUE );


but I thouht that was default...

:)

many thanks for your helping hand
/Amders


"fungus" <openglMY@SOCKSartlum.com> wrote in message news:9oB6d.162$4W6.124@news.ono.com...
> Anders Lind�n wrote:
> > Hello fungus! Thanks for your fast reply!
> >
> > I thought the texture matrix was identity in the beginning of my code execution.
> > Isnt that right?
> >
>
> Yes but maybe you were doing the scale every pass
> or something.
>
>
> --
> <\___/>          For email, remove my socks.
> / O O \
> \_____/  FTB.    The Cheat is not dead!
>
>


0
Reply Anders 9/29/2004 6:12:33 PM

6 Replies
191 Views

(page loaded in 0.093 seconds)

Similiar Articles:













7/18/2012 11:51:36 AM


Reply: