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: How to read a text (txt) file, modify and save - comp.soft-sys ...... help me but I never did something with reading/modifying ... text files / save data as ... How to save a texture to a ... How to save text and numerical matrix in one txt file ... simple question about MODEL matrix - comp.graphics.api.opengl ...What operations/functions in OpenGL API creates/modify this MODEL matrix? ... it this article: > http://developer.nvidia.com/object/Projective_Texture ... HVS, DWT coefficients, image features - comp.soft-sys.matlab ...... of the image, Luminance (Brightness) , Texture ... Extract data from cell using matrix ... Entropy,contrast ... to model the HVS behavior, the DWT ... modifying the DWT ... comp.graphics.api.opengl - page 10I use gluLookAt to modify my modelview matrix. What I do is that I rotate the ... like PC screen in a 3d ambient in your opinion, is using glutBitmapCharacter() in a texture ... How Convert TXT data format to MAT data format - comp.soft-sys ...I'm using a script that saves data (x,y) as .mat files ... How to read a text (txt) file, modify and save - comp ... Converting Certain Data from Numeric Matrix to Text ... convert mat files (struct) to ascii text files / save data as ...I'm using a script that saves data (x,y) as .mat files ... How to save a texture to a file - comp.graphics.api.opengl ... ... How to save text and numerical matrix in one txt file ... bitmap as array - comp.graphics.api.opengl... that I can use either of A1,A2,A3 in making a texture in ... So, when using image data don't bother with C ... device, creates an image. Use bitmaps to create, modify ... How to keep potens results what function to use? - comp.soft-sys ...... The outputs from the function are an n x 4 matrix (dat ... How to save a texture to a ... ... how to write ... ... Procedures and User-Defined Functions You cannot modify ... bump map from normal map ? - comp.graphics.api.openglUsing real-valued variables, the height field is z = H ... linear system of equations where the coefficient matrix ... the impression of a detailed 3D surface, by modifying the ... get pixel color - comp.graphics.api.opengl... glLoadIdentity(); You set up your projection matrix ... and the amount of blur becomes important how to modify ... color and/or alpha of the polygon upon which you texture ... drawing three spheres using gluSphere - opengl - Mofeel Groups1. Intersection of three spheres. 2. modifying the texture matrix + using gluSphere Hello! I have modified my texture matrix by doing this: glMatrixMode(GL_TEXTURE ... gluSphere Texture Mapping - opengl - Mofeel Groupsmodifying the texture matrix + using gluSphere Hello! I have modified my texture matrix by doing this: glMatrixMode(GL_TEXTURE); glScaled(double(w1)/double(w2 ... 7/18/2012 11:51:36 AM
|