GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tastycode/ReflectionView: A swift class for stereoscopic CALayer drawing for AR/VR

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
README.md
README.md
 
 
ReflectionView.swift
ReflectionView.swift
 
 

Repository files navigation

ReflectionView

2017-10-19 23 09 58 (ReflectionView running in ARKitExample)

Have a complex rendering pipeline? Can the end-result of your pipeline be nested in a single UIView? Do you need that view to present itself as two duplicate views so the view will appear as a single image when viewed through a VR headset?

You've found the most useful highly niche library for AR/VR yet.

I've used this to:

  • Replicate a react-native rendered app overlay for stereoscopic presentation
  • Replicate an ARKit renderer and allow "stereoscopic on rotation" experiences.

How to use

  1. Create constraints so that the ReflectionView instance takes half the screen
  2. Put the views you want doubled inside the ReflectionView

image

Auto-flipping on rotation

You'll need to create two layouts, one for portrait, another for landscape. See https://medium.com/@craiggrummitt/size-classes-in-interface-builder-in-xcode-8-74f20a541195.

Then you'll need something like this:

  override func willTransition(to newCollection: UITraitCollection, with coordinator: UIViewControllerTransitionCoordinator) {
    coordinator.animate(alongsideTransition: { (_) in
        let orient = UIApplication.shared.statusBarOrientation

        switch orient {
        case .portrait:
            self.reflectionView.replicator.instanceCount = 1
         default:
            self.reflectionView.replicator.instanceCount = 2
        }
    }, completion: nil)

    super.willTransition(to: newCollection, with: coordinator)
  }

Apps using this library

  • Tastyglass

License

MIT

Feeling thankful?

BTC: 1NEf77g7aFpsLGXf88ie1Bueze7QxbH2mN ETH: 0x428D3ebACfe19a33B6265C20FFffb25cEB45df0A

Twitter: @tastycode

About

A swift class for stereoscopic CALayer drawing for AR/VR

Resources

Readme
Activity

Stars

5 stars

Watchers

2 watching

Forks

1 fork
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.