PDA

View Full Version : Obj Exporter


gmlealll
12-18-2008, 03:59 PM
Iím trying to replicate the output of the max 2009 obj exporter by guruware but I donít really understand the way they are creating the vertex normalís.

Apparently it goes trough the vertex twice but skipping some vertex the second time, I can get the first pass correctly with this code


tmpNormArr = #()

for i = 1 to meshObj.numverts do
(
in coordsys local normals = meshop.getFaceRNormals meshObj i

for j = 1 to 3 do
(
n_X = normals[j][1]
n_Y = normals[j][2]
n_Z = normals[j][3]
format "vn % % % \n" n_X n_Y n_Z to:out_file
)

append tmpNormArr normals
)

But I have no idea what the second pass does. Has anyone look at it?

Guillermo Leal.

gmlealll
12-18-2008, 09:56 PM
Upps silly error I should have meshObj.numFaces and not meshObj.numverts



Thanks anyway.

Guillermo Leal.

CGTalk Moderation
12-18-2008, 09:56 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.