Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualHypnotiC

Posted 17 April 2013 - 09:36 AM

1. the reason you can't display both texture is the following:

In each frame, you set the model view matrix to identity, which maps the whole viewport to [-1,1]x[-1,1].

And both of your calls to Render() draw the quad covering [-1,1]x[-1,1].

So now you load first texture and draw a quad, the texture will be mapped to whole viewport,

then you load the second texture and draw a quad, which is also mapped to the whole viewport (so the second one overlaps the first one).

Thus you can only see one texture.

 

2. As for the texture size,

1) because you model view matrix is identity,

2) and you quad covers the whole viewport,

3) your texture coordinates cover the whole image

so you always see the texture as big as your viewport, right?

You can change any of 1)~3), for example, change from Render(1,1,0) to Render(0.5,0.5,0), then the texture would be come 1/4 of the original size

[ if you choose 3), you may also need to change the wrap options ]

 

Hope this helps


#1HypnotiC

Posted 17 April 2013 - 09:34 AM

1. the reason you can't display both texture is the following:

In each frame, you set the model view matrix to identity, which maps the whole viewport to [-1,1]x[-1,1].

And both of your calls to Render() draw the quad covering [-1,1]x[-1,1].

So now you load first texture and draw a quad, the texture will be mapped to whole viewport,

then you load the second texture and draw a quad, which is also mapped to the whole viewport (so the second one overlaps the first one).

Thus you can only see one texture.

 

2. As for the texture size,

1) because you model view matrix is identity,

2) and you quad covers the whole viewport,

3) your texture coordinates cover the whole image

so you always see the texture as big as your viewport, right? (if you choose 3), you may also need to change the wrap options)

You can change any of 1)~3), for example, change from Render(1,1,0) to Render(0.5,0.5,0), then the texture would be come 1/4 of the original size

 

Hope this helps


PARTNERS