[Closed] Flatten point3 values to a matrix plane?
Okay, I know that if I have a group of objects I can flatten them along an arbitrary plane
for o in <object array> do
(
in coordSys <matrix> o.pos.z = 0
)
But, how do I do it with pure point3 (i.e. [x,y,z]) values? I’ve tried variations on
for p in <point array> do
(
in coordSys <matrix> p.z = 0
)
but Max keeps ignoring the coordinate system and just flattens them to the world-space z plane. Do coordinate systems just not work on point3 values? If so, what do I need to do instead?
you have some coord sys -> tm
point3 in world coord sys -> pt
pt in coord sys tm -> p = pt*(inverse tm)
flatten in coord sys tm -> p.z = 0
back to world -> p*tm
teapot dir:[10,10,10]
in Coordsys $teapot01(Converttopoly (S = Sphere radius:10 pos:[0,0,50] dir:$teapot01.dir))
in Coordsys $teapot01(for v = 1 to S.numverts do
(
vertPos = polyop.getvert S v
polyop.setvert S v [vertPos.x,vertPos.y,80] --make the z = 0
)
)
RedrawViews()
Thanks Denis, that did the trick.
I was getting a little frustrated because I knew I had made this work before, but I completely forgot how it was done. I guess it was a case of being too close to the problem, something that seems to happen to me more than I’d like…