Pivot and/or coordinate system bug in mesh-exporting (MaxScript)? -


i have problem position exporting text file, guess it's related pivots , coordinate system.

to illustrate it, made 2 scenes in 3ds max looks same, different: enter image description here

for simplification, you can consider x-axis. @ first 1 pivot of sphere has been change (moved [-50,0,0] default position) , sphere position has been set [0,0,0]. @ second, sphere pivot @ default position (center of sphere) , sphere's position [50,0,0]). rest of spheres point of reference.

after exporting script both spheres have exact same vertices' position. but guess first 1 should have vertices' positions transformed [-50,0,0] offset pivot has been changed (it's center of object space, isn't it?).

both scenes should second one: enter image description here

the position of spheres ok such ([0,0,0] both) , relative positions of vertices (to each other) (they still form sphere). because of problem i've mentioned in previous paragraph (no difference in vertices positions), the first scene renders incorrectly - sphere "visible" @ [0,0,0] instead of [50,0,0]. pivot change affected object position not vertices position (they not relative pivot?).

my code:

--create vertices array (with duplicates, 3 vertices each face) f = 1 (meshop.getnumfaces emesh) (      face = getface emesh f      = 1 3 ( --for each of 3 vertices in face (triangle)         vertexpos = (getvert emesh face[i]) * (inverse emesh.objecttransform)  --vertex position in object space (including rotation) 

so, want sort of node space positions, not world positions, relative node pivot, right?

the node pivot transform overlapping object transform if reset xform/rebuild mesh, otherwise relative position/rotation/scale object stored objectoffsetpos, objectoffsetrot , objectoffsetscale. have understand difference between node , object here, there can 1 object , multiple nodes referencing same object (instances), different transforms , different properties including pivot pos/rot/scale. using inverse emesh.objecttransform, return same value different pivot positions, you'd have use emesh.transform instead.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -