teocomi / BCFier

Extensible BCF client and tools
http://bcfier.com/
GNU General Public License v3.0
120 stars 73 forks source link

Revit Import - Perspective Camera - Not Perpendicular Vectors Throw Exception #8

Closed GeorgDangl closed 8 years ago

GeorgDangl commented 8 years ago

We're having troubles importing a BCF XML 2.0 Viewpoint into BCFier for Revit when the perspective camera up- and direction vectors are not perpendicular. The following camera within a perspective camera does cause an exception when the viewpoint is selected:

<CameraDirection>
  <X>0.764</X>
  <Y>-0.516</Y>
  <Z>-0.389</Z>
</CameraDirection>
<CameraUpVector>
  <X>-0.14</X>
  <Y>0.095</Y>
  <Z>0.986</Z>
</CameraUpVector>

The exception is thrown at this file, line 64 (return new ViewOrientation3D(newC, newUp, newView);).

If we set the vectors to, p.e. 1,0,0 and 0,0,1 (or any other values where we get a 90° angle between the vectors) it's working. Our cameras come from a WebGL based viewer (Three.js) and we just hand them without changes to the BCF XML (and then open it in BCFier).

We're not sure if this is an error on our side or with BCFier, but we found that the camera seems to work in other products.

teocomi commented 8 years ago

@GeorgDangl I'm afraid the CameraUp and CameraDirection vectors have to be perpendicular to each other in a view. Take as example Revit's View3D documentation: http://help.autodesk.com/view/RVT/2016/ENU/?guid=GUID-A7FA8DBC-830E-482D-9B66-147399524442