im just thinking, what would be the best way to texture or mask an image in js.
Would be nice if i could just use an svg as shape and either fill that with a texture (shape is moving, texture sticks to it) or use the svg to mask an image (shape is moving, you see different parts of the image behind it.
im not sure if the mask() command works dynamically, in a way that the mask is calculated each frame when its moved
im also not sure how much performance it takes with the alpha mask, when i actually just need complete transparent, or hidden.
and this change for the JAVASCRIPT version did help
gl = canvas.getContext(ctxNames[i]);
im wondering if there are more options of smoothing
the STANDARD version looks worse than the WEB version. smooth() doesnt do anything and the hint(ENABLE_OPENGL_4X_SMOOTH); throws an error
"cannot find anything named "ENABLE_OPENGL_4X_SMOOTH"
i basically draw triangles in 3d that rotate. im using a orthographic projection.
for some reasons there are some angles where the shapes are perfectly smooth. different angles of the triangles that result in the same 2D shape are very edgy …
i have some questions and im looking for some advise for a smart approach …
what i want to build is something like this.
i the beginning there should be a plane.
this plane should be intersectable by a line (ray?), imagine the plane would be a sheet of paper and the intersectionlines are the bends where you folded the sheet.
one very simple option could be that there is a line in the middle of the plane, dividing it into 2 quads (2 planes/shapes).
those shapes should be able to turn on the bend (like if you would fold a sheet of paper in the middle)
if you have more intersections (lines) you probably would get some polygons that can turn but are all connected on the bending edge
now what im looking for is a very fine color gradient from the light in the shapes, based on their angle and direction to the light.
i was thinking that the toxiclibs WETriangleMesh would do a good job, since i comes with gouraud shading and is able to use different subdivision modes.
so the questions are:
is this in general a good approach?
how to i divide the plane (or maybe terrain) into polygons by intersection lines (rays)?
what is the difference between plane and terrain?
is there a way to get a WETriangleMesh from polygons?
what is the difference between a WETriangleMesh and a TriangleMesh?
if i want to "fold"(put them in different angles to eachother) those different shapes, but want them to be subdivided in tiny peaces, would it make sense to transform those polygons first, make a mesh of the shapes, and subdivide then?
its really a buch of questions, i know, but i would be so thankful if someone would read this and has a idea to this …
i have the feeling that this could be a lot easier if someone knows what the toxi stuff is capable of.