Mark Coniglio

01-15-2007, 07:02 PM

I'm attempting to render a single image that can span two monitors. Given an example screen dimension of 320x240, I am setting the viewport like this:

Monitor 1: glViewport(0, 0, 640, 240)

Monitor 2: glViewport(-320, 0, 640, 240)

This produces the result I'm looking for in that as the model moves across the monitors, it looks perfectly aligned at the split.

The issues is that I had to set the viewport width to 640 to make this work -- otherwise if I just offset a 320 horizontal port left or right, the model is clipped.

So, is there a way to translate the viewport without scaling it? (I.e., perform a translation when everything is transformed from normalized device coordinates to window coordinates)?

Thanks in advance,

Mark

P.S. I suppose I could scale all of the coordinates horizontally with the Projection Matrix, but then the perspective will be off, etc., right?

Monitor 1: glViewport(0, 0, 640, 240)

Monitor 2: glViewport(-320, 0, 640, 240)

This produces the result I'm looking for in that as the model moves across the monitors, it looks perfectly aligned at the split.

The issues is that I had to set the viewport width to 640 to make this work -- otherwise if I just offset a 320 horizontal port left or right, the model is clipped.

So, is there a way to translate the viewport without scaling it? (I.e., perform a translation when everything is transformed from normalized device coordinates to window coordinates)?

Thanks in advance,

Mark

P.S. I suppose I could scale all of the coordinates horizontally with the Projection Matrix, but then the perspective will be off, etc., right?