Javescript

Help with Javascript to transform vector structure triangle into collider triangle structure.

axlrecords's picture

I made a composition using the Carasuelo Open CV . I use the Convex Hulls structure result of the above patch and transformed into vector with "kineme vector with line structure" patch and then I close the vector with the "Kineme vector close" patch. I scaled the vector with the "Kineme vector transform" and scale it 1 to 1. A this point I use the "Kineme Extrusion with vector" in order to get a structure of triangles that is the result of the extrusion of the shape coming out from the Carasuelo. The structure result is suitable for a GL Triangle structure render. My goal is to feed this structure into a Kineme collider triangle but the point is that the structure result is made by member that contain 6 elements, 3 of that are the XYZ position of every vertex of the triangles, while the collider needs a one dimensional array with the xyz position of every vertex. I don't have any clue in how to write a java script that convert the structure I have as a result of the vector transformation in a structure suitable for the collider patch. Please see the two type of structures in the jpg attached. The struct vector jpg is the type of structure that needs to be transformed into the type of structure of the struct collider jpg. Does some one can help me ? THX