flat-surface-shader
flat-surface-shader copied to clipboard
Different shapes
Is there a way to modify it to create different shapes other than triangles?
Or where can I start to look into using different shapes other than triangles?
Thank you in advance.
Look into the examples folder, you will see the code that display squared shapes with static triangles.
Notice this:
var geometry = new FSS.Plane(600, 400, 6, 4);
Then, use
console.log(geometry);
to see what is inside it. After that, you will find out "triangles" is inside it. Continue...
At last you will get:
geometry > triangles > a or b or c > Vertex
So,you can use
geometry.triangles[0].a = new FSS.Vertex(Somenumber,Somenumber,Somenumber);
geometry.triangles[0].b = new FSS.Vertex(Somenumber,Somenumber,Somenumber);
geometry.triangles[0].c = new FSS.Vertex(Somenumber,Somenumber,Somenumber);
to change the position of a point.

I'm not very skilled of this, I was found out that just now. And my English is not good, hope you can get what I mean.
well,I did some trial.Although it's not very good,but at least it's work.
