Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Maxscript Normals Issue

Post questions about game models here, or help out others!
Post Reply
dainazinas
advanced
Posts: 40
Joined: Tue Jan 31, 2012 8:32 pm
Has thanked: 18 times
Been thanked: 12 times

Maxscript Normals Issue

Post by dainazinas »

I`m building a mesh importer and I got a problem. When I apply a texture on the build mesh object it looks inverted(TEXT, numbers). Flipping normals don`t do any good. And I can`t seem to find an answer in the help files.

https://www.dropbox.com/s/vhntho32z2kjs ... .03.29.png

So I suspect it has to be done before the mesh is build from vert and face arrays?
here`s the snip of my script

--Build Mesh From Arrays
mesh1 = mesh vertices:Vert_array faces:Face_array
mesh1.numTVerts = UV_array.count
buildTVFaces mesh1
for j = 1 to nm_array.count do meshop.setMapVert mesh1 1 j nm_array[j]
for j = 1 to Face_array.count do meshop.setMapFace mesh1 1 j Face_array[j]


anyone has any clues?
User avatar
Chipicao
ultra-veteran
ultra-veteran
Posts: 476
Joined: Thu Feb 03, 2011 11:18 am
Has thanked: 42 times
Been thanked: 305 times
Contact:

Re: Maxscript Normals Issue

Post by Chipicao »

It has nothing to do with normals, the mesh itself needs to be mirrored. Specifically, it looks like you need to load vertices as [-x, y, z].
You can also tell by the fact that the watch is on the right hand, whereas it should be on the left. ;)

Careful when doing this! Inverting or switching an odd number of vertex components will reverse the face winding. Activate backface cull on your mesh and see if it looks ok. If it doesn't, you'll need to flip face indices ([i3, i2, i1] instead of [i1, i2, i3]]
Please post any requests or issues with my tools in the appropriate topics.
I'm sorry if I don't reply or if I ignore PMs. My time is very limited.
dainazinas
advanced
Posts: 40
Joined: Tue Jan 31, 2012 8:32 pm
Has thanked: 18 times
Been thanked: 12 times

Re: Maxscript Normals Issue

Post by dainazinas »

Your a star Chipicao. -Vpx does the job beautifully, thank you so much :)
Post Reply