Camera angle setup for parallel projection


#1

hi, I am trying to setup a serie of camera using line as input to define camera location and target. But I can’t find a way to setup the camera angle. I am interested with parallel projection. can someone help me on this?
thx

public  void CreateCameraFromPath(Curve CamPath, string Name)
{
  var camStart = CamPath.PointAtStart;
  var camEnd = CamPath.PointAtEnd;

  Rhino.Display.RhinoView view = Rhino.RhinoDoc.ActiveDoc.Views.ActiveView;
  Rhino.Display.RhinoViewport vp = view.ActiveViewport;

  vp.Name = Name;
  //vp.SetProjection(Rhino.Display.DefinedViewportProjection.Front, Name, true);
  vp.PushViewProjection();
  vp.ChangeToParallelProjection(true);

  vp.CameraUp = Rhino.Geometry.Vector3d.ZAxis;
  vp.SetCameraLocation(camStart, false);
  vp.SetCameraDirection(camEnd - camStart, true);
  vp.SetCameraTarget(camEnd, true);


  this._doc.NamedViews.Add(Name, vp.Id);
  view.Redraw();

}


#2

anyone? basically I am trying to find a way to define camera from a “pyramid”.

  • Top of the pyramid is location of the camera.
  • Bottom of the pyramid is the target to look at.
    But I am struggling to setup the camera angle the same as the pyramid…

(Dale Fugier) #3

How would you do this just using Rhino? The aspect radio of the view might come into play here.

– Dale


#4

found it !

RhinoViewport.ZoomBoundingBox Method