Login  Register

Re: Extending Functionality of Shader Programs

Posted by ElvJOGL on Feb 11, 2016; 7:43am
URL: https://forum.jogamp.org/Extending-Functionality-of-Shader-Programs-tp4036139p4036170.html

elect wrote
Thanks, the voice is totally fine, really understandable, only the volume is crap (also the blue color, even in fullscreen it's hard to see), I had to max it out and it is still barely enough, but I guess making video is not that easy, so don't mind ;)

Don't worry about the delay, I can image it takes its time


Anyway, one thing I don't get

if we start by:

(5, 5), (10, 5), (10, 10)

we end up with 3 new triangles

(10, 10), (15, 10), (15, 15)     (15, 10), (20, 10), (20, 15)   (15, 15), (20, 15), (20, 20)

and if you draw them, an empty space, big as the original triangle (just inverted on the hypotenuse), will be at the center of the new shape, that is (15,10), (20, 15), (15, 15)

Your program instead doesn not render that empty space..

Moreover, its area, using the old-school way, should be 5 * 5 / 2=12.5 you get 15 + 6 / 2 - 1 = 17 instead.. how do you explain this discrepancy?
To answer your question by parts I will say this.

1). when you do the points {5, 5}, {10, 5}, {10, 10}, you are still missing what's inside the region, that is something I fill in using a barycentric interpolation equation I get from Real Time Collision textbook my video game programming professor referred to me. So you don't get tree triangles, what you are seeing is a permutation of points that lie at each end of the corners or the vertices, and the points that lie inside of the triangle. You right, logically they should look like 3 triangles, but infact they are not, is just the scale more of the next polygon.

2) you asked explain the discrepancy from 5 * 5 / 2 = 12.5 and [I] get 15 + 6/2 - 1 = 17 instead. All I can say is that both equations are correct. However when you take your equation (which I will refer to the equation they teach in preschool and highschool the area of the triangle) and the difference between Pickt's Theorem equation is that Your Equation deals with NOT TO SCALE triangle drawings. And pick's Theorem deals with TO SCALE Triangle models. That is hard to grasp at first, but my math professor who assigned this task to me said it to me at of times, that both equations are correct, but both are not referring to same scale or the same size of the model. (And by model I mean the polygon such as the triangle).

But tell me do you understand the basic idea of where I am trying to get to.

I figure that Shader technology can help me with and I was hope I can get some insight.