I’m using RhinoCommon dll with C#.
I’d like to disable the camera rotation in a view with parallel projection but with a different direction than top or front view.
Then I change some camera settings in order to adapt it to an object :
//Vector3d vector = something calculated from an object;
//BoundingBox bbox = bounding box of an object;
myView.MainViewport.SetCameraDirection(vector, false);
myView.MainViewport.ZoomBoundingBox(bbox);
My view faces my object like I want, but with right-click the user can rotate the camera… And I’d like right-click to only move the camera position in the perpendicular plane to my vector, but I didn’t find any RhinoViewport method which could solve my problem…
Sorry for my poor English and thank you in advance for your answers !
Actually, I didn’t really solve the problem :
My purpose was to face up a parallel camera to a plane, and only allow zoom and translation in order to keep the orientation.
Instead of that, I apply a transformation on my plane so as to it lines up with the X and Z axis, and I use front view (which has the camera properties that I want). When the users manipulations are done, the inverse transformation is performed.
Tools → Options → View → Pan: Always pan parallel views = on
Make sure your viewport has parallel projection & no perspective.
The easiest way is to modify the top / front / side view, which are already set to parallel.
I make a flat small plane that is oriented flat / perpendicular to the direction I want to look.
Align the camera with View → Set camera → Orient camera to surface. Pick the plane.
A great workflow is to place small planes on their own ‘c-plane’ layer and then locate them everywhere you need to align the c-plane or camera. Make a keyboard shortcut for both commands and you’ll be able to jam!
command 1: Set CPlane | To Object (for grid & c-plane)
command 2: Set camera | Orient camera to surface (for camera alignment)
EDIT: This seems like a good topic for a video. Thoughts?