All Projects → brocoo → Brsuntracker

brocoo / Brsuntracker

Licence: apache-2.0
Augmented Reality classes that track and displays the sun position on the screen, available on Cocoapods

Projects that are alternatives of or similar to Brsuntracker

Eval Vislam
Toolkit for VI-SLAM evaluation.
Stars: ✭ 89 (-27.64%)
Mutual labels:  augmented-reality
Awesome Arcore
A curated list of awesome ARCore projects and resources. Feel free to contribute!
Stars: ✭ 106 (-13.82%)
Mutual labels:  augmented-reality
Coreml In Arkit
Simple project to detect objects and display 3D labels above them in AR. This serves as a basic Template for an ARKit project to use CoreML.
Stars: ✭ 1,534 (+1147.15%)
Mutual labels:  augmented-reality
Ar Alphabets
Augmented Reality on Web (Web AR) for Kids to learn Alphabets with fun. AR on all Mobile Devices
Stars: ✭ 98 (-20.33%)
Mutual labels:  augmented-reality
Arkit 2 Image Tracking Demo
iOS 12 + ARKit 2 + Image tracking means: Harry Potter style moving pictures, living movie posters, video postcards, paper-thin “displays,” and lots more augmented reality fun.
Stars: ✭ 102 (-17.07%)
Mutual labels:  augmented-reality
Xr Unity
8th Wall XR Unity projects and resources. Feel free to contribute!
Stars: ✭ 108 (-12.2%)
Mutual labels:  augmented-reality
Webxr Input Profiles
WebXR Gamepad assets, source library, and schema
Stars: ✭ 72 (-41.46%)
Mutual labels:  augmented-reality
Arkit Floorislava
Basic ARKit example that detects planes and makes them lava.
Stars: ✭ 120 (-2.44%)
Mutual labels:  augmented-reality
Chilitags
Robust Fiducial Markers for Augmented Reality And Robotics
Stars: ✭ 104 (-15.45%)
Mutual labels:  augmented-reality
Viro
ViroReact: AR and VR using React Native
Stars: ✭ 1,735 (+1310.57%)
Mutual labels:  augmented-reality
Objectron
Objectron is a dataset of short, object-centric video clips. In addition, the videos also contain AR session metadata including camera poses, sparse point-clouds and planes. In each video, the camera moves around and above the object and captures it from different views. Each object is annotated with a 3D bounding box. The 3D bounding box describes the object’s position, orientation, and dimensions. The dataset contains about 15K annotated video clips and 4M annotated images in the following categories: bikes, books, bottles, cameras, cereal boxes, chairs, cups, laptops, and shoes
Stars: ✭ 1,352 (+999.19%)
Mutual labels:  augmented-reality
Arvisualizer
Prototype of a real-time visualization tool for ARKit sessions
Stars: ✭ 102 (-17.07%)
Mutual labels:  augmented-reality
Aruco Markers
Working examples/tutorial for detection and pose estimation of ArUco markers with C++
Stars: ✭ 112 (-8.94%)
Mutual labels:  augmented-reality
Sketch By Phone
A proof-of-concept of Augmented Reality with HTML5
Stars: ✭ 95 (-22.76%)
Mutual labels:  augmented-reality
Arplayer
Playback videos using ARKit and AVFoundation.
Stars: ✭ 117 (-4.88%)
Mutual labels:  augmented-reality
Arkitgamespritekit
A game inspired by Pokemon Go build with ARKit and SpriteKit
Stars: ✭ 87 (-29.27%)
Mutual labels:  augmented-reality
Nativescript Ar
Augmented Reality NativeScript plugin
Stars: ✭ 107 (-13.01%)
Mutual labels:  augmented-reality
Wwdc Recap
A collection of session summaries in markdown format, from WWDC 20, 19 & 17
Stars: ✭ 121 (-1.63%)
Mutual labels:  augmented-reality
Geomapping With Unity Mapbox
Geomap is the virtualization of data that maps a Country. Mapbox Unity SDK gives data(Global map layers of Streets, Buildings, Elev, and Satellite) generating custom 3D worlds for Mobile VR/AR apps.
Stars: ✭ 118 (-4.07%)
Mutual labels:  augmented-reality
Apertusvr
Virtual Reality Software Library
Stars: ✭ 112 (-8.94%)
Mutual labels:  augmented-reality

BRSunTracker

BRSunTracker is a set of classes using Augmented Reality that allow you to track and display the position of the sun on your device screen, based on your current GPS location, the device gyroscope, the time and the date.

The position of the sun in the sky is computed via the PSA Algorithm, and its position on the screen uses the device rotation matrix provided by the gyroscope (See "How does it work?" section below). BRSunTracker also works during the night, just aim at your feet to find to find the sun.

The sample app included displays a marker on a camera preview that follows the sun on the screen and snaps to the middle of the view once the phone is oriented towards it.

http://i.imgur.com/RyTVnY6.png http://i.imgur.com/UbxsJs5.gif

Installation

BRSunTracker is available through CocoaPods, to install it simply add the following line to your Podfile:

pod "BRSunTracker"

Usage

  1. Import the BRSunTrackerView class into your view controller:
  #import "BRSunTrackerView.h"
  1. Instanciate BRSunTrackerView and add it as a subview.
BRSunTrackerView *sunTrackerView = [[BRSunTrackerView alloc] initWithFrame:CGRectMake(0, 0, 320, 428)];
[self.view addSubview:sunTrackerView];

Or you can also add a BRSunTrackerView directly via the Interface Builder.

  1. By default, the BRSunTrackerView will display a camera preview, and a default marker following the sun. You can enable or disable the camera and provide your own UIView as a marker by setting these properties:
  // Enable or disable the camera preview
  // (The default value is YES)
  [sunTrackerView setDisplayCameraPreview:YES];

  // Provide your own marker subview 
  // (otherwise will display the default one)
  [sunTrackerView setSunView:myMarkerView];
  1. (Optional) Set your view controller as the delegate of the BRSunTrackerView and make it conform to the BRSunTrackerViewDelegate protocol. Implement the following methods to detect when the phone is aligned with the sun:
  [sunTrackerView setDelegate:self];  
  - (void)sunTrackerViewGotFocus:(BRSunTrackerView *)sunTrackerView{
      NSLog(@"The sun is aligned with the device.");
  }
  
  - (void)sunTrackerViewLostFocus:(BRSunTrackerView *)sunTrackerView{
      NSLog(@"The sun is not aligned with the device anymore.");
  }
  1. Grab a pair of sunglasses (and a cold drink).

How does it work?

A diagram explaining roughly the process of computing the sun 2D screen coordinates in BRSunTracker is shown below. All of this happens inside the BRSunTracker class. The gyroscope orientation data is currently sampled 60 times per second, the sun spherical coordinates are computed every minute or when the GPS location gets updated.

http://i.imgur.com/aF1SeW5.png

Sources and acknowledgements

pARk, Apple code sample showing a basic Augmented Reality implementation

PSA Algorithm, C++ function that computes the spherical coordinates of the sun based on the GPS coordinates, the time and date.

Stack Overflow, My initial Stack Overflow post about how to compare the device orientation with the sun position.

Thanks to Dan Marson who provided the GIF shown above.

This feature was conceived and built for the "Piano Ombre" album-app concept for Frànçois and the Atlas Mountains, now available on the App Store.

Author

Julien Ducret - [email protected]

Follow me on Twitter @jbrocoo

Check out my app: Spores

Licence

BRSunTracker is under Apache licence, see the LICENCE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].