PDA

View Full Version : texture lost



sujin
02-16-2000, 10:50 PM
hi,
I displayed texture-mapped model and no texture-mapped model. But first i displayed the texture-mapped model correctly, then change to display the no-texture model, it's all right.
But when i change to display the texture mapped model again, the texture almost disappear--it is also a simple model. Only when rotating the model I notice some triangle edge with color.
I thought this is the buffer problem, but i do not know how to solve it?
thanks.

[This message has been edited by sujin (edited 02-16-2000).]

paolom
02-17-2000, 01:43 AM
Your explanation is not of very much help, but I will try anyway to give you a checklist.
Firstly, what do you mean by switching a 'model' ? I assume that you're enabling and disabling GL_TEXTURE_2D; if you are using two completely different objects, let me know.
Anyway you should check:
- state changes affecting GL_TEXTURE_2D
- texture params, such as GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, wrapping, etc.
- texture environment params, such as mode
- texture coordinates; are you using generation?

sujin
02-17-2000, 02:45 AM
what is the option
?
- texture environment params, such as mode texture coordinates; are you using generation?

Anyway I know how to display a texture mapped object correctly.

I use a SDI VC program, then i save a 3D geometry model(including its coordinates, its texture coordinates).

If i display the object without drawing any line or others, it will display correctly. Then i can only disply the object without texture.
But after then i want to display the textured object, the texture disappear.
the display change by click a button, following set a flag: mTexFlag=true or mModelFg=true.
that's all.

paolom
02-17-2000, 03:03 AM
Mmhh. I'm still confused.
Can you post a code snippet, where the rendering and state change happen?

dmy
02-17-2000, 04:21 AM
normally when texturing, the underlying color is set to white (glColor3f(1,1,1))

since you're rendering a textured model, then a non-textured one and then again you use textures, maybe you forgot to set the color/material again to white...
or maybe is a lighting problem.

try to render your models without texturing, without lighting and color set to white to see what happens.

Dolo/\/\ightY



[This message has been edited by dmy (edited 02-17-2000).]

dans
02-17-2000, 10:05 AM
[QUOTE]Originally posted by sujin:

I use a SDI VC program, then i save a 3D geometry model(including its coordinates, its texture coordinates).
------------------------------------

Whats this programme called? Where can I get it?

Thanks
Dan S.

sujin
02-17-2000, 05:41 PM
It seems no buffer using tricks in texture mapping. I solved my problem this morning, it's too simple for i define the polygon mode to GL_LINE and when using texture , i forgot to set the mode to GL_FILL!
thanks for oyur response.