Tastenkunst / brfv4_javascript_examples

BRFv4 - HTML5/Javascript - examples project. Reference implementation for all other platform example packages.
463 stars 148 forks source link

Generating UV cords from face image #18

Closed andy-mcdonald closed 6 years ago

andy-mcdonald commented 6 years ago

In the 'face texture overlay' example, I can see that a base64 image and an array of uv coordinates are being imported from /assets/brfv4_face_textures.js - how are those uv coordinates being generated?

I tried mapping another face image and then saving normalized coords from the resulting vertices. When I add the base64 encoded string and the new uv array to brfv4_face_textures.js I don't get the result I was expecting (ie: the new face being mapped instead of Marcel's). I can see the texture but it appears to be fixed while the triangles are all messed up... I'm obviously saving the uv coords in the wrong order. Any help on the technique that was originally used to generate the sample data?

astrolope commented 6 years ago

Heyo, I'm trying to accomplish the same thing. How did you go about generating the UV array from your new image?

MarcelKlammer commented 6 years ago

Please read about it here, hope that helps: https://github.com/Tastenkunst/brfv4_javascript_examples/issues/22