flat-surface-shader icon indicating copy to clipboard operation
flat-surface-shader copied to clipboard

Different shapes

Open albertpak opened this issue 11 years ago • 1 comments

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.

albertpak avatar Jul 24 '14 15:07 albertpak

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. show

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. 20151105171651

SaekiRaku avatar Nov 05 '15 09:11 SaekiRaku