LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3D Picture Control Doesn't Zoom in Orthographic Mode

I am using a 3D Picture Control in LabVIEW.  When the 3D Picture control's Auto Projection attribute is set to "Perspective", then shift dragging within the Picture Control seems to move the camera, effectively moving the image being viewed.  When the Auto Projection attribute is set to "Orthographic", then the same magnifying class mouse cursor is used, but shift dragging doesn't do anything.  I wanted to know if this is expected behavior.  If so, I'll post and idea to the LabVIEW Idea Exchange.  If it is a bug, is there a tracking number to see it get fixed?  I'm using LabVIEW 8.6

 

Here are the steps to reproduce:

1. Open "Using Meshes.vi" at

C:\Program Files\National Instruments\LabVIEW 8.6\examples\picture\3D Picture Control\Using Meshes.vi

2. Set the "Draw Mode" ring control to Polygon (its easier to see) and run the VI.

3. Hold down the Shift key and click and drag in the 3D Picture Control.  Note that the polygon appears to zoom.

4. Press the stop button.

5. Right click on the 3D Picture Control and select "Auto Projection" then "Orthographic"

6. Run the VI.

7. Hold down the Shift key and click and drag in the 3D Picture Control.  Note that the polygon does not zoom.

 

Work around:

The 3D Picture Control has a method "Projection.Orthographic" that can be used to programmatically control the view area.

 

Thanks,

Shawn

0 Kudos
Message 1 of 12
(4,659 Views)

Hello Shawn

 

Thank you very much for bringing this to our attention.  I will be looking into this matter.

 

Thank you for choosing National Instruments!

Sincerely,

Greg S.
0 Kudos
Message 2 of 12
(4,647 Views)

Additional Notes on the 3D Picture Control:

1) The camera for the scene can be configured pragmatically with the 3D Picture Control "Setup Camera" Method.

2) The behavior of the camera can be read or set with the 3D Picture Control "CameraController.Type" and "CameraController.AutoRedraw" properties.  These properties may also be set by right-clicking on the 3D Picture Control on the Front Panel when the VI is not running.

3) The "AutoProjection" property may be set to None, Orthographic, or Perspective.  This affects the projection matrix which determines how the objects are drawn.

4) In Orthographic AutoProjection, the camera distance from the target position does not affect the apparent sizes of objects in the scene.  The "Projection.Orthographic" method of the 3D Picture Control may be used to define how large of an area is viewable by the camera.  This method uses parameters (Left, Right, Bottom, Top, Near Clipping Plane, Far Clipping Plane) that are relative to the camera position.  Differences between Right, Left and Bottom, Top must be proportional to the pixel size of the 3D Picture Control or the scene will be distorted.

 

For Spherical Cameras:

1) Dragging an area in the 3D Picture Control will rotate the camera about the "Target" position specified with the "Setup Camera" method (or about the default "Target" position).

2) Control dragging will translate the camera position and the target position by the same amount.  This allows the target position to be moved within the scene.

3) Shift Dragging will move the camera position closer to or further from the Target.  The camera position moves along a line that passes through the camera and the target position.

4) Shift dragging while the 3D Picture Control is set to Orthographic does move the camera.  If there are clipping planes, the view of the scene may be clipped as the camera's clipping planes move through the scene objects.  However, the apparent size of the objects in the scene do not change as the camera moves.

 

My opinion is that the behavior of the Spherical Camera in Orthographic mode makes sense once it is understood, but it is confusing to get started with.  Also, although the behavior makes sense, I think a greater use case would be met by automatically adjusting the camera parameters in Orthographic mode so that it behaved like Perspective mode instead of just moving the camera.  I'll leave it to other posters (assuming any have trudged this far through my posting) to correct me if I've gotten something wrong.

 

At this point I think I understand what is going on enough to try to create a work around.  My biggest problem, however, is that I don't see a way to get the camera target position.  It seems like it must be stored internally since the Spherical Camera rotates around it when dragging within the Picture Control.  However, I don't see a way to get this.  It would be nice to read this parameter since it would help determine the camera parameters to use in Orthographic projection to zoom.  Does someone knows how to get the camera target position?  The camera position itself can be obtained by looking at the ModelView matrix.

Message 3 of 12
(4,640 Views)

Thank you for all this information.  I am in the process of verifying this and submitting the information to the appropiate parties.

Sincerely,

Greg S.
0 Kudos
Message 4 of 12
(4,625 Views)

Hello SWalpole

 

I am in the process of creating a corrective action request for this issue.  I will be in touch shortly with the reference number for your records.

 

Thank you for your patience as I address your concern.

Sincerely,

Greg S.
0 Kudos
Message 5 of 12
(4,590 Views)

@Greg S wrote:

Hello SWalpole

 

I am in the process of creating a corrective action request for this issue.  I will be in touch shortly with the reference number for your records.

 

Thank you for your patience as I address your concern.


 

Is this going to be a doc CAR or LV CAR?

 

I'll buy yhr doc CAR but we really could tolerate a good set of doce for the 3D picture.

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 12
(4,583 Views)

Hello SWalpole and Ben

 

I created this correction action request as an LV CAR. Here is the reference information.

 

Request #: 302192 Description: 3D Picture Control Doesn't Zoom in Orthographic Mode 

Please let me know if I can be of further assistance.  All the best and thank you very much for your feedback!  We really appreciate community involvement at National Instruments!

Sincerely,

Greg S.
0 Kudos
Message 7 of 12
(4,572 Views)

Hello,

Has the Orthographic Zoom been fixed? I too am trying to use this option and does not appear to work.

I am curently using LabView2012 V12 32-bit.

Thanks

Mark

 

0 Kudos
Message 8 of 12
(4,185 Views)

Hello Hartmme,

 

As noted by the original poster, this behavior is intentional.  Refer to http://en.wikipedia.org/wiki/Parallel_projection#Limitations . Orthographic projection is used when you *don't* want perspective.

 

When shift-dragging in the 3D control, the camera/viewport does move (which is what dragging on the control does, it's not actually ever "zooming"), however there is no apparent change in the scale of the scene due to the projection method.  If you need to make the object larger or smaller on the front panel, you'll need to actually change the object's size or rescale the projection view.

 

Regards,

Tom L.
0 Kudos
Message 9 of 12
(4,169 Views)

Hello Tom,

Thanks for the response. I understand that in Orthographic mode you do not want to change the perspective, however I would like to change the scale of the image when holding the shift key and dragging, similar to the original request.

 

4) Shift dragging while the 3D Picture Control is set to Orthographic does move the camera.  If there are clipping planes, the view of the scene may be clipped as the camera's clipping planes move through the scene objects.  However, the apparent size of the objects in the scene do not change as the camera moves.

 

My opinion is that the behavior of the Spherical Camera in Orthographic mode makes sense once it is understood, but it is confusing to get started with.  Also, although the behavior makes sense, I think a greater use case would be met by automatically adjusting the camera parameters in Orthographic mode so that it behaved like Perspective mode instead of just moving the camera.  I'll leave it to other posters (assuming any have trudged this far through my posting) to correct me if I've gotten something wrong.

 

Based on Greg's comments, I thought a request 302192 was entered to make this change.

 

I have played with the Projection Matrix of my 3D image and have been able to create a zoom in like approach while in Orthographic. Is there a recommended way to programmatically to link the shift dragging to change the scale to achieve a similar result? I also am having trouble finding good detail that outlines what each parameter is of the 4x4 Projection Matrix.

 

Thanks

Mark

 

 

 

 

 

Message 10 of 12
(4,138 Views)