xml3d / xml3d.js

The WebGL/JS implementation of XML3D
Other
75 stars 25 forks source link

Normal mapping #184

Closed Arsakes closed 8 years ago

Arsakes commented 8 years ago

Hi, is there any utility that will help me with computing tangent/bitangent vectors for model? I want to implement normal mapping - this seem to be only difficulty.

It would be perfect is XML3D could generate them.

csvurt commented 8 years ago

Hi, here's an Xflow operator that generates tangent vectors:

http://xml3d.org/xml3d/shade-studio/external/script/calculateTangents.js

<data compute="tangent = xflow.calculateTangents(index, normal, texcoord)">
   <!-- Mesh data containing index, positions, normal, texcoord -->
</data>