Looking Glass Documentation
Buy Looking GlassDiscord
  • Looking Glass User Guide
  • NEW! โœจLooking Glass Goโœจ
  • Displays
    • ๐Ÿ”ฎLooking Glass Go
      • โšกGet Started with Looking Glass Go
      • ๐Ÿ“ฑUsing the Go Mobile App
      • ๐Ÿ”†Liteformsโ„ข
      • ๐Ÿ–ฅ๏ธStandalone and Desktop Modes
      • ๐Ÿ”ŒPower and LED States
      • ๐Ÿช„Default Playlist
      • โญ๏ธWhat's Next?
      • ๐Ÿ‘œAccessories
      • โš™๏ธAdvanced Playlist Creation
      • โš™๏ธManual Firmware Update
      • โ“Common Troubleshooting Issues
    • ๐Ÿ”ฎLooking Glass 16" Light Field Displays
      • ๐Ÿช„Looking Glass 16" Light Field Display (Landscape)
      • ๐Ÿช„Looking Glass 16" Light Field Display (Portrait)
      • โ“Common Troubleshooting Issues
    • ๐Ÿ”ฎLooking Glass 32" Light Field Displays
      • ๐Ÿช„Looking Glass 32" Light Field Display (Landscape)
      • ๐Ÿช„Looking Glass 32" Light Field Display (Portrait)
      • โ“Common Troubleshooting Issues
    • ๐Ÿ”ฎLooking Glass 65" Light Field Display
    • ๐Ÿ”ฎLooking Glass Portrait
      • โšกGet Started with Looking Glass Portrait
      • ๐ŸŽ‡Demo Holograms
      • โ“Common Troubleshooting Issues
  • Software Tools
    • ๐Ÿ“šOverview
    • ๐ŸŒ‰Looking Glass Bridge
      • โœจUsing Looking Glass Bridge
      • ๐ŸชŸDisplay Settings on Windows
      • ๐ŸŽDisplay Settings on macOS
      • ๐ŸงDisplay Settings on Linux
      • ๐Ÿ‘ทTroubleshooting
    • ๐Ÿ“ฝ๏ธLooking Glass Studio
      • ๐Ÿ“šUsing Looking Glass Studio
      • RGB-D Photo / Video
      • Quilt Images / Video
      • iPhone Portrait Photos
      • Android Depth Photos
        • Samsung Portrait Mode
      • Light Field Photosets
      • Exporting Holograms
      • Troubleshooting
    • ๐ŸงŠLooking Glass Blocks
      • โœจConvert any image into a hologram
      • โฌ†๏ธUploading, editing and sharing Quilts
      • ๐ŸฅฝViewing your holograms on different platforms
    • ๐ŸŽฌHologram Video
    • ๐Ÿ”†Liteformsโ„ข
      • ๐ŸชŸGet Started on Windows
      • ๐ŸŽGet Started on MacOS
      • ๐Ÿง™Making Custom Liteforms
      • ๐ŸชConfigure Liteforms for Kiosk Setup
    • ๐Ÿ‘€Looking Glass Model Viewer
    • ๐ŸงชExperiments
      • ๐Ÿ“ฝ๏ธMedia Encoder
      • โฉLooking Glass Media Encoder
  • Key Concepts
    • ๐Ÿ”‘Hologram 101
      • ๐ŸŽ‰Making great holograms
      • ๐ŸŒŽHolograms in the real world
      • ๐Ÿ‘พHolograms, but virtual
    • ๐Ÿ”How does Looking Glass Work?
    • ๐Ÿ“ธVirtual Camera
    • ๐ŸงŠ3D Design Guidelines
      • Lighting
      • Post-Processing
      • Scene Composition
      • Materials & Textures
      • Performance
    • ๐Ÿ’กQuilts
      • ๐ŸŽฌQuilt Video Encoding
    • ๐Ÿ’กLight Fields
      • โšกLinear Light Field Capture
    • ๐Ÿ“ฝ๏ธFilming a Looking Glass
  • Creator Tools
    • ๐ŸŽจOverview
    • ๐Ÿ”ŒUnity
      • โšกUsing Unity with Looking Glass
      • Setting up your Development Environment
      • Example Scenes
      • Prefabs
        • Hologram Camera
        • 3D Cursor
        • Dual Monitor Application
      • Script Reference
        • HologramCamera.cs
        • LKGDisplaySystem.cs
        • QuiltCapture.cs
        • Cursor3D.cs
        • OrbitControls.cs
        • BlockUploader.cs
        • MobileDMAController.cs
        • iOS Sample Scene Scripts
          • ChangeInteractionModality.cs
          • XYSlider.cs
          • XYSpotlight.cs
          • AudioRotateControl.cs
          • ModelController.cs
          • DemoIOSUIController.cs
          • PageHandler.cs
          • PageConnectHandler.cs
          • PageCalibrateHandler.cs
          • PageTestHandler.cs
          • DynamicAlcove.cs
      • Package Integrations
        • Built-in Render Pipeline Post-Processing
      • Developing for iOS
      • Depth of Field and Other Post-Processing Effects
      • Quilt Video Audio and Playback
      • Developing for Ultraleap Hand Tracking on Looking Glass
      • Looking Glass Pro (Legacy)
      • Additional Support
      • Change Log
    • ๐ŸนBlender
    • ๐Ÿ”ŒUnreal Engine
      • ๐Ÿ—’๏ธChange Log and Old Versions
      • ๐Ÿ’ฝInstalling the Unreal Engine plugin
      • ๐ŸŽฅUsing the Unreal Engine Plugin
        • Using the HoloPlay Capture
        • Exporting Quilt Images and Video with Sequencer
      • Accessing HoloPlay Data with Blueprint Scripting
      • Packaging the Project
      • Unreal Engine 4 (Legacy Support)
        • Unreal Engine 4 Quick Start
          • Using the HoloPlay Capture
          • Exporting Quilt Images and Video with Sequencer
    • ๐ŸŒWebXR
      • ๐Ÿ”ถPlayCanvas
      • 3๏ธโƒฃ3๏ธโƒฃ Three.JS
      • โš›๏ธReact-Three-Fiber
      • ๐ŸŒˆSpline
  • Tutorials
    • ๐Ÿ“ฑRunning Looking Glass Displays with iOS Devices
    • โ“‚๏ธCapturing Light Fields in Maya
    • ๐Ÿง‘โ€๐Ÿ”ฌUsing ShaderToy with Looking Glass
    • ๐ŸŽจSculpting with Adobe Medium and Looking Glass
    • ๐Ÿ”Turn Videogames Holographic with Refract
    • ๐Ÿ–๏ธBuilding with Leap Motion
  • Developer Docs
    • โš™๏ธLooking Glass Bridge SDK
      • ๐Ÿช›Web Application Integration
      • ๐Ÿ”ŒIntegrating Native Applications
      • ๐Ÿ““Native Function Reference
    • ๐ŸฆLooking Glass Core Migration Guide
  • Third Party Software
    • ๐Ÿ—ก๏ธ3D Slicer
    • ๐Ÿ”ฌVTK (Visualization Toolkit)
    • ๐Ÿ—บ๏ธParaView
    • ๐Ÿ”ฉCommunity Made Tools & Projects
  • Legacy Software
    • ๐Ÿ“ก3D Model Importer
      • 3D Model Importer App Guide
      • 3D Model Importer App Reference
    • ๐ŸŽญDiorama
      • Change Log
    • ๐ŸŽž๏ธDepth Recorder
    • ๐Ÿ“ธLightfield Photo App
    • ๐ŸLooking Glass Core Overview
    • ๐Ÿฝ๏ธLooking Glass Core SDK
      • C API Overview
        • HoloPlayCore.h
          • State Functions
          • General-Query-Functions
          • Device-Query-Functions
        • libHoloPlayCore.h
        • HoloPlayShaders.h
    • ๐Ÿ”ฐLooking Glass Core JS
      • API
        • HoloPlayCore.Client
        • HoloPlayCore.Message
        • HoloPlay Service Related
        • examples
  • Legacy Hardware
    • ๐Ÿ”ปLooking Glass 8.9"
    • ๐Ÿ”ปLooking Glass 15.6"
    • ๐Ÿ”ปLooking Glass 8K
    • ๐Ÿ”ปLooking Glass 16"
    • ๐Ÿ”ปLooking Glass 32"
    • ๐Ÿ”ปLooking Glass Pro
  • ๐Ÿ’ฌContact Us
  • ๐Ÿ› ๏ธFAQ & Troubleshooting
Powered by GitBook

Follow us

  • Twitter
  • Instagram
  • LinkedIn
On this page
  • Field of View
  • View Cone
  • Frustum
  • Offset

Was this helpful?

  1. Key Concepts

Virtual Camera

PreviousHow does Looking Glass Work?Next3D Design Guidelines

Last updated 1 year ago

Was this helpful?

The goal with the camera is to emulate what the human eye would see if the 3D scene were real in physical space. The easiest way to think of this is imagining that the screen at the base of the Looking Glass were a window pane: a flat rectangular portal through which we're viewing the 3D objects.

Field of View

The 8.9" Looking Glass screen is roughly 4.75" vertically. If we assume the average viewing distance for a user sitting at their desk is about 36", our field of view should be about 14ยฐ. There is no correct answer, as it all depends on your expected user's distance from the Looking Glass, but we've found the most success using this figure.

View Cone

The Looking Glass Portrait has a valid viewing angle of about 58ยฐ total, or 25-30ยฐ in each direction from center. Due to refractive properties of the glass itself, the digital view angle that we find that renders best is 35ยฐ. We emulate this in software by starting our view rendering -17.5ยฐ from center and moving to +17.5ยฐ from center.

The most intuitive approach to this might be to choose a pivot point and let the camera revolve 35ยฐ around it, but that produces an effect called toe-in, which is not what we want. Remember the window pane analogy: if there were a window grill at the same depth as the screen, we'd want it to be drawn flat on the screen from all viewing angles, not rotated from the sides.

Offset

Toe-in

Frustum

To achieve this, we want to move the camera horizontally (change the view matrix) and shift the frustum in the opposing direction (change the projection matrix). We also want to keep the near clipping plane close to emulating the real depth of the Looking Glass; it's okay to let it come forward a little bit, but it quickly becomes unbearable if it's too far out. For the far clipping plane, we can get away with a little more recess, because the difference between each view is less intense way out back.

The focal plane, or zero parallax plane, is where all the views converge. This virtual plane is analogous to the physical screen at the base of the Looking Glass. When framing subject matter to be displayed in the Looking Glass, it's best to center it within this focal plane, because that's where the subject will appear as crisp and in focus as possible.

Offset

It's important to keep that in mind when choosing an approach to positioning the camera and calculating offset. There are a number of values that are determined by one another, so we want to be able to control the most useful values, and let the rest be determined -- the most useful being the camera size and focal plane position. The FOV was already set previously, based on our imagined average user distance.

Given a value Camera Size (which is the vertical radius of the focal plane), the FOV, and the center position of the focal plane, we can determine how far back the camera should be positioned locally on the z axis. Once we know that, we can also determine what the offset should be, given the offset angle for each view.

The code would look something like this:

// set up the camera with the view and the shader of the rendering object
void HoloPlayContext::setupVirtualCameraForView(int currentViewIndex, glm::mat4 currentViewMatrix) {
  // field of view is always 14 according to measurement
  const float fov = glm::radians(14.0f);
  // calculate the camera distance, which is actually static when camera size keeps the same
  float cameraDistance = -cameraSize / tan(fov / 2.0f);
  // start at -viewCone * 0.5 and go up to viewCone * 0.5
  float offsetAngle = (currentViewIndex / (qs_totalViews - 1.0f) - 0.5f) * glm::radians(viewCone);  
  // calculate offset
  float offset = cameraDistance * tan(offsetAngle);  
  // calculate the offset that the camera should move
  // move the camera by offset and camera distance at x and z direction
  viewMatrix = glm::translate(currentViewMatrix, glm::vec3(offset, 0.0f, cameraDistance));
  float aspectRatio = getWindowRatio();
 // main projection is always the same
  projectionMatrix = glm::perspective(fov, aspectRatio, 0.1f, 100.0f);
  // changes the projection matrix to be parallel
  projectionMatrix[2][0] += offset / (cameraSize * aspectRatio);
}

Feel free to experiment and adapt this approach to your project's needs!

๐Ÿ“ธ
FOV
View Cone
Frustums
Camera Offset
No Toe-in
Toe-in