Why potatoeses

Started by
13 comments, last by alvaro 9 years, 8 months ago

I chose [-1,1] instead of [0,1] because that's the typical range of NDC. If I remember correctly, OpenGL uses [-1,1] for all three axes, and DirectX uses [-1,1] for x and y and [0,1] for z.


Oh, so by adding 1 you make it positive and later divide by 2 to make up for adding 'that half of the screen' ???


Yes. One way to think about it is that (x + 1) / 2 maps the interval [-1,1] to [0,1], and multiplying by Width maps [0,1] to [0,Width].
Advertisement

 


I grew up in an environment where I didn't know anyone that knew math or programming, and I was really interested in both. I didn't have access to many books and the Internet hadn't been invented yet. All in all, you are probably better off learning in today's environment, with easy online access to tons of resources and experts. But there is something to be said about learning to fight with a problem and having to learn to convince yourself that your answer is correct without external help, by trying a few examples or proving a few theorems. I think you should give it a try and find out for yourself if you are right or not.


The counter to that is that debugging is an important skill for a programmer. The most important thing you might learn with your current efforts could very well be the ability to efficiently explore the workings of your program so you can understand those "quirks".

Your formulas are probably right, although the notation you used to describe what your are doing is imprecise or at least not standard.

This topic is closed to new replies.

Advertisement