Notifications
Clear all
[Closed] Move subselection in grid/screen space?
Jul 06, 2010 5:16 am
I just realized something today. If I use either of the following:
in coordsys screen move $ [100,100,0]
in coordsys grid move $ [100,100,0]
this works fine. However, if I try to use either of these:
in coordsys screen move $.selectedFaces [100,100,0]
in coordsys grid move $.selectedFaces [100,100,0]
it completely ignores the coordsys. Is there any way around this?
2 Replies
Jul 06, 2010 5:16 am
instead of using coordsys, multiply your offset by an appropriate rotation matrix. For example
-- for grid coordsys
obj = activeGrid
tm = obj.transform
tm.pos = [0,0,0]
myOffset = [10,10,0]
gridOffset = myOffset * tm
move $.selectedFaces gridOffset
Jul 06, 2010 5:16 am
So right now I have gotten it to work in screen space using an intermediary, essentially like this:
global screenGrid = grid
screenGrid.transform = inverse(getViewTM())
screenGrid.pos = [0,0,0]
move theSelect [x,y,z] * screenGrid.transform)
This works fine for orthographic and user views, but it doesn’t quite work for a perspective view. What is it I need to do for that to work? I know I have seen perspective view transformations done but I can’t recall how it’s done, or find any examples at the moment…