Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


#ActualSuperVGA

Posted 21 July 2013 - 06:16 AM

In your code, you have swapped both the near and far planes, and the view direction. Those two negates each other. If you use an orthographic projection with the same eye and target position, and same near and far planes, you will get an equivalent view of the scene. Only the vertical and horizontal scaling will be different, but that is a natural result of the fundamental differences between the two types of projections.

Hi, thanks for responding. The code for the projection is actually a copy of how glOrtho already works (see the glOrtho entry, paste the markup for the page into http://www.madogiwa.org/display-mathml/live.html to get the actual formulas (or use an mml client)). I'll guess Id only need to reverse the depth check to make it work,

but even then it doesn't seem to do the same thing as only using glOrtho without swapping the values. (Also, I read somewhere that only the far value should be negative)

 

(I'm still basically saying: I cannot replace glFrustrum with glOrtho and expect the same items showing (disregarding of the perspective vs parallel projection bit))

 

I have to change the eye position or the depth test.

 

At least, I haven't been able to make it just by changing the projection.


#4SuperVGA

Posted 21 July 2013 - 06:15 AM

In your code, you have swapped both the near and far planes, and the view direction. Those two negates each other. If you use an orthographic projection with the same eye and target position, and same near and far planes, you will get an equivalent view of the scene. Only the vertical and horizontal scaling will be different, but that is a natural result of the fundamental differences between the two types of projections.

Hi, thanks for responding. The code for the projection is actually a copy of how glOrtho already works (see the glOrtho entry, paste the markup for the page into http://www.madogiwa.org/display-mathml/live.html to get the actual formulas (or use an mml client)). I'll need to reverse the depth check to make it work,

(I'm still basically saying: I cannot replace glFrustrum with glOrtho and expect the same items showing (disregarding of the perspective vs parallel projection bit))

 

I have to change the eye position or the depth test.

 

At least, I haven't been able to make it just by changing the projection.


#3SuperVGA

Posted 21 July 2013 - 06:14 AM

In your code, you have swapped both the near and far planes, and the view direction. Those two negates each other. If you use an orthographic projection with the same eye and target position, and same near and far planes, you will get an equivalent view of the scene. Only the vertical and horizontal scaling will be different, but that is a natural result of the fundamental differences between the two types of projections.

Hi, thanks for responding. The code for the projection is actually a copy of how glOrtho already works (see the glOrtho entry, paste the markup for the page into http://www.madogiwa.org/display-mathml/live.html to get the actual formulas (or use an mml client)). I'll need to reverse the depth check to make it work,

(I'm still basically saying: I cannot replace glFrustrum with glOrtho and expect the same items showing (disregarding of the perspective vs parallel projection bit))

 

I have to change the eye position or the depth test.


#2SuperVGA

Posted 21 July 2013 - 06:14 AM

In your code, you have swapped both the near and far planes, and the view direction. Those two negates each other. If you use an orthographic projection with the same eye and target position, and same near and far planes, you will get an equivalent view of the scene. Only the vertical and horizontal scaling will be different, but that is a natural result of the fundamental differences between the two types of projections.

Hi, thanks for responding. The code for the projection is actually a copy of how glOrtho already works (see the glOrtho entry, paste the markup for the page into http://www.madogiwa.org/display-mathml/live.html to get the actual formulas (or use a mml client)). I'll need to reverse the depth check to make it work,

(I'm still basically saying: I cannot replace glFrustrum with glOrtho and expect the same items showing (disregarding of the perspective vs parallel projection bit))

 

I have to change the eye position or the depth test.


#1SuperVGA

Posted 21 July 2013 - 06:12 AM

In your code, you have swapped both the near and far planes, and the view direction. Those two negates each other. If you use an orthographic projection with the same eye and target position, and same near and far planes, you will get an equivalent view of the scene. Only the vertical and horizontal scaling will be different, but that is a natural result of the fundamental differences between the two types of projections.

Hi, thanks for responding. The code for the projection is actually a copy of how glOrtho already works. I'll need to reverse the depth check to make it work,

(I'm still basically saying: I cannot replace glFrustrum with glOrtho and expect the same items showing (disregarding of the perspective vs parallel projection bit))

 

I have to change the eye position or the depth test.


PARTNERS