• Create Account

### #ActualGamer Pro

Posted 25 February 2013 - 11:17 AM

Oooh. I thought the distance was a radius thing. 'You have the pan the camera this much in some direction' kind of thing.

However, it looks like distance calculate is coming up short.

Before panning:

[attachment=13886:before pan.png]

After panning:

[attachment=13887:after pan.png]

Now ignoring that the panning is wrong, the box should fit the screen, or at worse, spill past either the top or bottom of the screen due to bad/no panning. The distance calculation seems fine.

bottom size = half map x * absolute(x-axis • bottom normal) +
half map y * absolute(y-axis • bottom normal) +
half map z * absolute(z-axis • bottom normal)
left size = half map x * absolute(x-axis • left normal) +
half map y * absolute(y-axis • left normal) +
half map z * absolute(z-axis • left normal)
and etc..

vertical distance = (top size + bottom size) / (2 * sin(vertical FoV / 2))
horizontal distance = (leftSize + rightSize) / (2 * sin(horizontal FoV / 2))

distance = max(vertical distance, horizontal distance)

camera position = normalized camera direction * distance


### #3Gamer Pro

Posted 25 February 2013 - 11:16 AM

Oooh. I thought the distance was a radius thing. 'You have the pan the camera this much in some direction' kind of thing.

However, it looks like distance calculate is coming up short.

Before panning:

[attachment=13886:before pan.png]

After panning:

[attachment=13887:after pan.png]

Now ignoring that the panning is wrong, the box should fit the screen, or at worse, spill past either the top or bottom of the screen due to bad/no panning. The distance calculation seems find.

bottom size = half map x * absolute(x-axis • bottom normal) +
half map y * absolute(y-axis • bottom normal) +
half map z * absolute(z-axis • bottom normal)
left size = half map x * absolute(x-axis • left normal) +
half map y * absolute(y-axis • left normal) +
half map z * absolute(z-axis • left normal)
and etc..

vertical distance = (top size + bottom size) / (2 * sin(vertical FoV / 2))
horizontal distance = (leftSize + rightSize) / (2 * sin(horizontal FoV / 2))

distance = max(vertical distance, horizontal distance)

camera position = normalized camera direction * distance


### #2Gamer Pro

Posted 25 February 2013 - 11:14 AM

Oooh. I thought the distance was a radius thing. 'You have the pan the camera this much in some direction' kind of thing.

However, it looks like distance calculate is coming up short.

Before panning:

[attachment=13886:before pan.png]

After panning:

[attachment=13887:after pan.png]

Now ignoring that the panning is wrong, the box should fit the screen; rather than having it 'spill' past the top and bottom of the screen. The distance calculation seems find.

bottom size = half map x * absolute(x-axis • bottom normal) +
half map y * absolute(y-axis • bottom normal) +
half map z * absolute(z-axis • bottom normal)
left size = half map x * absolute(x-axis • left normal) +
half map y * absolute(y-axis • left normal) +
half map z * absolute(z-axis • left normal)
and etc..

vertical distance = (top size + bottom size) / (2 * sin(vertical FoV / 2))
horizontal distance = (leftSize + rightSize) / (2 * sin(horizontal FoV / 2))

distance = max(vertical distance, horizontal distance)

camera position = normalized camera direction * distance


### #1Gamer Pro

Posted 25 February 2013 - 10:44 AM

Oooh. I thought the distance was a radius thing. 'You have the pan the camera this much in some direction' kind of thing.

However, it looks like distance calculate is coming up short.

Before panning:

[attachment=13886:before pan.png]

After panning:

[attachment=13887:after pan.png]

Now ignoring that the panning is wrong, the box should fit the screen; rather than having it 'spill' past the top and bottom of the screen. I'm going to play around with it (maybe I miss-typed something again) but I thought I'd post in the mean time.

PARTNERS