urgrund
09-14-2009, 09:24 AM
hey -
I can't seem to get a correct relationship between a vertices position and its normal through using the Edit_Normals modifier.
What I am wanting to do is 'explode' all normals away from the averaged center (some foliage lighting experiment)... I noticed the standalone command setNormal <mesh> <vert_index_integer> <point3> does not appear to change any normals?
So - I figured I'd try the Edit_Normals modifier... this at least yeilds modified normals when I change them. For what I'm trying to achieve, I need to have the position of the vertex that this normal is attached to... but there isn't a correlation between EditNormalsMod.GetNormal() (which needs a NormalID) and EditNormalsMod.GetVertex()(which needs a VertexID)... how can I get the relationship?
...another oddity:
If I set the normal to be the position of the vertex of the same ID in MaxScriptListener I get correct results. That is, each vertex 'explodes' away from the center as expected.
obj=$ -- this is usually an EditMesh object
obj.modifiers[#Edit_Normals].EditNormalsMod.setNormal 2 (obj.modifiers[#Edit_Normals].GetVertex(3))
But if I use this exact same code (literally copy pasted) in my script, it will modify a different vertex! What's going on! :)
Thanks!
I can't seem to get a correct relationship between a vertices position and its normal through using the Edit_Normals modifier.
What I am wanting to do is 'explode' all normals away from the averaged center (some foliage lighting experiment)... I noticed the standalone command setNormal <mesh> <vert_index_integer> <point3> does not appear to change any normals?
So - I figured I'd try the Edit_Normals modifier... this at least yeilds modified normals when I change them. For what I'm trying to achieve, I need to have the position of the vertex that this normal is attached to... but there isn't a correlation between EditNormalsMod.GetNormal() (which needs a NormalID) and EditNormalsMod.GetVertex()(which needs a VertexID)... how can I get the relationship?
...another oddity:
If I set the normal to be the position of the vertex of the same ID in MaxScriptListener I get correct results. That is, each vertex 'explodes' away from the center as expected.
obj=$ -- this is usually an EditMesh object
obj.modifiers[#Edit_Normals].EditNormalsMod.setNormal 2 (obj.modifiers[#Edit_Normals].GetVertex(3))
But if I use this exact same code (literally copy pasted) in my script, it will modify a different vertex! What's going on! :)
Thanks!
