Wrench

12-03-2008, 04:49 PM

Hi all

I am very new to maxscript and am receiving really wierd results from a simple if statement, I cannot understand what I am doing wrong so forgive me if this may seem trivial to you.

What I am doing is generating a random amount of faces, some that are perpendicular to the z-axis and others that are not. Problem is, at random intervals the statement returns false when in actual fact it should be returning true. This is happening even if all face normals are exactly the same.

for i=1 to faceNum do

(

p = polyOp.getFaceNormal $ i

if p == [0, 0, 1] then

(

print "true"

)

else

(

print "false"

)

)

At the moment p = [0,0,1] at every increment of i and yet I am still getting falses every now and again. What am I doing wrong?

Thanks in advance

Luca

I am very new to maxscript and am receiving really wierd results from a simple if statement, I cannot understand what I am doing wrong so forgive me if this may seem trivial to you.

What I am doing is generating a random amount of faces, some that are perpendicular to the z-axis and others that are not. Problem is, at random intervals the statement returns false when in actual fact it should be returning true. This is happening even if all face normals are exactly the same.

for i=1 to faceNum do

(

p = polyOp.getFaceNormal $ i

if p == [0, 0, 1] then

(

print "true"

)

else

(

print "false"

)

)

At the moment p = [0,0,1] at every increment of i and yet I am still getting falses every now and again. What am I doing wrong?

Thanks in advance

Luca