MAXScript vertex philosophy

Started by
10 comments, last by experiment 10 years, 2 months ago

why do you cry over my shoulder you posted pseudo code? I did not offend you for doing so. And I am not gonna be your guest to correct your very code for I believe I explained abstractly enough information for you to be aware of - diplayed in my pseudo code, about how verticies are treated in max. That there is simply a face index, wheather there are mapfaces or faces, and their indicies point to correct value. In your script you only write to a file unindexed texture coordinates of every face, I do not see anything about normals and positions you sepparated from texture coordinates-which- you append to an array upon vertex count not by the face way, as you do for texture coordinates. Your code absolutely violates indexing and vertex layout.

That escalated quickly. Sometimes I get it help sometimes I don't. It's not a big deal.

I thought you wanted me to post my code. But apparently it was a misunderstanding. No problem there either.

My code doesn't violate the vertex layout that I'm looking for right now. I am not even exporting index. As you can see I'm trying to export vertex information for each index member, in other words - for each triangle I am exporting 3 vertices. I am trying to get each of those vertices to hold:

- position

- normal

- texture coordinates

My position and normals are exported just fine. There is no violation of vertex layout if that's how I want it to be. My problem is getting the texture coordinates.

Right now I'm trying to do it like this:


tmesh = snapshotAsMesh selection[1];
num_faces = tmesh.numfaces;
T = #();

for i = 1 to num_faces do
(
    face = getFace tmesh i;
    tface = getTVFace tmesh i;
                
    T[face[1]] = getTVert tmesh tface[1];
    T[face[2]] = getTVert tmesh tface[2];
    T[face[3]] = getTVert tmesh tface[3];
)

And for some reason it isn't working correctly, as you could see from the picture above.

Advertisement

Okay. Found the cause of my problem. Actually just a tiny typo. As usual.

The code I posted above is correct.

5a1w.jpg

wheeee! happy.png

This topic is closed to new replies.

Advertisement