Welcome! Log In Create A New Profile


Need help with texture coordinates

Posted by owen 
Need help with texture coordinates
April 20, 2011 06:27PM
I think I am having a senior moment but this code is giving me a real headache. It runs fine but the texture is flipped left to right (facing away from me instead of towards me). I know it has something with one of my coordinates but I can't seem to get it it to work properly. Is the polygon facing the wrong direction? or is the texture coords? HELP!

	GRRLIB_ObjectView( x, 0,cubeZ*20, 0,0,0,30000, 30000, 1 );  //sky box/wall
    GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
         GX_Position3f32(1.0f,1.0f,1.0f);GX_Color1u32(effect_fog_color); GX_TexCoord2f32(0.0f,0.0f);
        GX_Position3f32(-1.0f,1.0f,1.0f);  GX_Color1u32(effect_fog_color); GX_TexCoord2f32(1.0f,0.0f);
        GX_Position3f32(-1.0f,-1.0f,1.0f);GX_Color1u32(effect_fog_color); GX_TexCoord2f32(1.0f,1.0f);
        GX_Position3f32(1.0f,-1.0f,1.0f); GX_Color1u32(effect_fog_color);  GX_TexCoord2f32(0.0f,1.0f);

I could rotate it but I do not want to that.
Re: Need help with texture coordinates
April 21, 2011 02:25AM
It looks like you're starting at the bottom right corner of the polygon but using the top left corner of the texture. Either start at the top-left position (-1.0f, -1.0f, 1.0f) or start at the bottom right of texture (1.0, 1.0).
Re: Need help with texture coordinates
April 21, 2011 04:39AM
aww yes, finally, thank you, I was there messing around with the texture coordinates the whole time.
Sorry, only registered users may post in this forum.

Click here to login