OT (sorry): Fixing tangent coordinates?

You guys are smart, so someone here should know.

How do I go about fixing tangent coords? I know I know, NVMeshMender, but I don’t use STL or C++ so I can’t use that (and I don’t know enough about STL to ‘port’ it to standard C).

If ANYONE knows, that would r0x0r my b0x0r!

When you say “tangent coordinates” do you mean texture coordinates or tangent vectors? Either way, wouldn’t we have to know what’s wrong with them to suggest a fix?

– Zeno

Vectors, you know… Those thingys you use for DOT3 lighting

if you mean how to create them, I wrote a small paper a while ago explaning how to get the formulas.

I am not fully sure that the logic of what I am saying is correct, but the formulas are.
http://members.rogers.com/deseric/tangentspace.htm

Calculating them I have no problem with, but they aren’t always correct (some will be pointing the wrong direction because of ‘mirror’ texture coords), NVMeshMender is suppose to fix these so they are all pointing the right direction, but as I said, I can’t use that.

Your time is probably well spent trying to learn enough C++ and STL to make MeshMender work for you. Worst case, you can always run it as a pre-processing step on your geometry data, and use it as-is in a “black box” pre-processing tool.

You don’t actually have to understand STL to find NVMeshMender Useful. I don’t actually use it. But I have borrowed snips from it quite a few times in building my own nice mesh generator. All NVMeshMender does is dubplicate vertices/texturecoords/tangents. Just about whatever it needs to fix the mesh. Just look through the code and ignore the pushback calls and the like. The code that does the actual work is basically C with a vector C++ class. But that is really self explanitory.

Devulon

with a very big chance you have a compiler that can compile c++. so you can simply use nvmeshmender in your code without switching to c++ yourself. all you need is to understand how to input and how to output to and from meshmender, and thats described in the headerfile and even if completely different to how you’ve coded till now, its straightforward and easy.

else, someone has to write a wrapper.
but i suggest to dive slowly into c++, means staying at your c-style but using the features c++ gives you (function overloading is my loved one )