From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to plot an object to different positions in 3D picture control

Hi,

 

I'd like to plot the same object to different positions in 3D picture control with different views, as following figure

 

1.JPG

 

I don't want to create the two exactly same object in block diagram. The object is large and complex. Recreating the object twice need lots of time. I know the object's viewport property can be used to render object to different position in 3d picture control, but the 3d picture control can not be plotted twice.

 

Is there any method to solve my problem? Thanks a lot...

0 Kudos
Message 1 of 15
(4,570 Views)

Please slow down and expalin some because you said

 

Can't have same object apear twice in one picture

Can't have two pictures

 

Aside from me suggesting you go to a holgraphic display and use a mirror, I don't what kind of option are open to help you.

 

If it was me, I'd use two insatnce of the same object and just use a transform to translate and rotate one of them.

 

Still a bit baffled,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 15
(4,549 Views)

You CAN use the Viewport to do this.

 

Create two base scene objects and define two different Viewports for the display.  See the help for Viewport to see how to do this.

 

Then add the object you have created to both Viewports and add both base objects together (Add Viewport 2 to Viewport 1).  You will now have two copies of your object at different locations in your 3D picture.

 

If you want to rotate one vs the other, do the rotations BEFORE adding both together in the last step.

 

Shane.

0 Kudos
Message 3 of 15
(4,238 Views)

Here's an example.  You need to be very careful which object references you use to do which operation.  The reference fed into "Add Object" or "Set drawable" is not valid after using these functions so make sure to use the output to use an object multiple times.

 

Shane.

Message 4 of 15
(4,229 Views)

If you don't want the two objects to have different rotation origins as in the example, then you don't even need the Viewports.  Just add the object twice and keep the references at the output of "Add Object" to manipulate the objects individually (Rotation and translation : most other changes will affect BOTH objects).

 

Here's an updated example which shows distinct and shared properties when an object is used multiple times.  Rotation is distinct, colour and basic object properties are shared.

 

Shane

 

0 Kudos
Message 5 of 15
(4,223 Views)

Nice example.

Now, if I want to use 3D glasses, I shoud rather specify the horizontal distance between the 2 "eyes"   for the 2 views (instead of the angle).

I thought this would be easy... horizontally translate the Objects in the Left image by 3cm to the right, and the opposite for the right image.

 

But then when I use the sperical camera controller, this doesnt work.... obviously.... the images no longer have to translate by the amount in the X plane, but "horizontal" on the current view.

Not so easy... I guess I have to read the current transformation and then move by the 3cm for each image...

Has anyone managed to get this right?

0 Kudos
Message 6 of 15
(3,951 Views)

Here is an example of using 3D picture controls to achieve a nice 3D effect with the Oculus Rift: DOC-41269. I intend to soon look at how using 3D glasses because I think that they would be more suitable to industrial applications than the Oculus Rift. Let me know if you find anyting. I have just started a 3D Vision group. That would be a nice place to post any progress you make with 3D glasses. 

Marc Dubois
0 Kudos
Message 7 of 15
(3,932 Views)

I had a look at using 3D glasses and a 3D Projector using LabVIEW (and also red-blue glasses). It can easily be done. Have a look at document 43869, it has a simple example on how to generate 3D stereo images.

 

Also, if you are interested, take the time to join the 3D vision group...

Marc Dubois
0 Kudos
Message 8 of 15
(3,839 Views)

Excellent, thank you.

Wow.... it is so simple when you know how. Quick summary:

1) Make two 3D pictures on the control panel (side by side).

2) Obtain the ModelView matrix of the left image (e.g.  Create - Property node - ModelView Matrix).

3) add 64mm to the X co-ordinate, and give this to the right hand image (i.e. + [[0,0,0,64],[0,0,0,0],[0,0,0,0],[0,0,0,0]] )

4) Make the left hand image controllable (e.g.  right click - Camera controller - Spherical).

6) wire your display to both 3Dpictures as you normally would.

5) update the 3D controls evey few ms in your program loop.

 

 

The right hand display will be looking at the same picture, but from 64mm to the right (or scale the 64mm to match your model)

Easy as pi.

0 Kudos
Message 9 of 15
(3,810 Views)

Hi Marc

 

I have both the Oculus rift and a old set of 3D glasses from Sony (Cinemizer).

The Cinemizer has better optics, better screen, is lighter to wear etc etc.

One drawback - it has not position feedback.

For industrial applications I would recommend the Cinemizer.

I hope Sony launches a new version soon, with full HD for both eyes..... that would be awesome.

 

Good luck.

 

0 Kudos
Message 10 of 15
(3,805 Views)