Software Archive
Read-only legacy content
17061 Discussions

Any documentation on virtual world box vs. real world box of developing RealSense application in Unity?

baolin_s_
Beginner
389 Views

Hi guys,

I'm just getting started to using RealSense to develop some tracking applications in Unity (starting from the AR Mirror sample). I came across this old post https://software.intel.com/en-us/forums/realsense/topic/537053 when I'm trying to fix the jerkily moving objects in the AR Mirror example ... but I don't quite understand how the virtual world box is supported to work. Would anyone please help me understand it or point me any reference to it?

Thanks,

-BS

0 Kudos
2 Replies
MartyG
Honored Contributor III
389 Views

Hi Baolin!  I'll give you a summary about the Virtual World Box.

*  It provides a barrier around an object containing a TrackingAction that defines how far that object can move before it is stopped.  Think of it like a sci-fi forcefield, except that instead of stopping things from getting near to your object, it stops your object from leaving the field. 

*  You will most commonly see its effects in objects whose constraints are set so that it can move its Position around (e.g up-down-left-right).  With objects that are constrained to be fixed on the spot (by having all Position constraints ticked) and rotate, the box tends to be useless.  This is because, as the object is rotating around on the spot, it is unable to touch the sides of the Virtual World Box surrounding it.

*  Regarding the Virtual World Box's default values of 100,100, 100, what this is basically saying is that you are telling Unity to draw a box of size 100 cm wide, 100 cm long and 100 cm tall around your object. 

In Position-based movement, you can ignore the Center values of the Virtual World Box, as they update their coordinates automatically.  If you are using Rotation-based movement though, I recommend clicking on the Self menu option and changing it to 'Custom', then setting all of the Center values to '0'.  This prevents the values from auto-updating during rotation and ensures that the center-point of your rotation is always centered precisely on the object and does not drift off to the side.

*  In a lot of projects, a 100 cm box will be too large to effectively constrain the movement of your object if its constraints allow its position to move around.  You will get a more controllable object if you use trial and error to find a much smaller value.  For example, in the position-based TrackingAction I use in my full-body avatar's mouth, I use a value of '1' to make the mouth able to open a short distance and then be stopped instead of detaching from the jaw.

*  You should avoid using a Virtual World Box value of '0'.  This is because the TrackingAction is programmed to change any Box values set to 0 to a value of '1' when you run the project.  I have observed that this change from 0 to 1 as the project starts seems to introduce instability into the joint.  A similar effect can occur when switching from one Smoothing type to another (e.g Weighted to Stabilizer) whilst the program is running.

Hope that information helps!  You may also like to view Intel's official documentation on the Virtual World box if you have not done so already.

https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/toolkit_tracking_action.html

0 Kudos
baolin_s_
Beginner
389 Views

Hi Marty, very much appreciate your detailed explanation!! It makes a lot of sense. And also thanks for pointing out the sdk document but I prefer your explanation anyway :-).

-BS

0 Kudos
Reply