Nudge command
All  1-4  5-8

Previous
Next
 From:  Michael Gibson
7353.5 In reply to 7353.4 
Hi Christopher,

> It would also be great if the default nudge amount was not
> "1.0" but instead the current grid snap value.

This one should be fairly straightforward - you can retrieve the current grid snap value by: moi.grid.snapSize;

So in the place in Nudge.js where it has the nudge amount = 1.0 make it be = moi.grid.snapSize instead.


The view dependent nudge is likely to be quite a bit more complex. You can get the view frame of the current viewport by calling moi.ui.getActiveViewport().cameraFrame

That returns an IMoiCoordinateFrame which a coordinate system with an origin point, and x y z axis directions. In this case the x-axis of the frame will be in the view's direction towards the right, the y-axis will be in the view's upwards direction and the z axis of the frame will be towards the eye point.

There is another call which returns view angles - but there is not just a single view angle like you say, there is a combination of 3: view.upDownAngle , view.leftRightAngle and view.tiltAngle.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Christopher (SCHARDT)
7353.6 In reply to 7353.5 
Thanks for the tip: "moi.grid.snapSize"!

I believe all I need for what I'd like Nudge to do is
view.upDownAngle
view.leftRightAngle
view.tiltAngle
What units are these in? Degrees?

I assume that upDownAngle==0 means looking in a horizontal direction. Are positive values up or down?

Are positive values of leftRightAngle left or right?

And what is tiltAngle?

Thanks again,
Christopher
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7353.7 In reply to 7353.6 
Hi Christopher,

> view.upDownAngle
> view.leftRightAngle
> view.tiltAngle
> What units are these in? Degrees?

Yes, they're in degrees.


> I assume that upDownAngle==0 means looking in a
> horizontal direction. Are positive values up or down?

An upDownAngle==0 means you are looking straight downwards, the up/down and left/right angle values are used as in a Spherical coordinate system as shown here:
http://en.wikipedia.org/wiki/Spherical_coordinate_system

upDownAngle is the angle the eye position is rotated downwards around the world xaxis, and left-right angle is the amount it swings left or right rotating around the zaxis.


> And what is tiltAngle?

tilt angle is the angle of rotation around the view vector, like the roll axis angle shown in this diagram (from Wikipedia):





> Are positive values of leftRightAngle left or right?

It should follow the right-hand rule with the orientation being the world z axis.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  ttype (STRUBE)
7353.8 In reply to 7353.4 
Hi, I've written a 2D version.

It checks which viewport the mouse is over:
https://github.com/thetumbledtype/moi3d-scripts-commands/blob/master/Nudge2D.js
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-4  5-8