Giter VIP home page Giter VIP logo

space-sketchr's Introduction

Space Sketchr

Releasable build v1.0

This code is able to run / export the latest version of Tango Doodle using Unity 4.

Overview

As with any Tango project, the first step is to import the Tango assets into your project.

Download from here: https://developers.google.com/project-tango/downloads

Go to Assets > Import Package > Custom package and select the package file. Leave all assets selected and import them. You should now have a TangoSDK folder in your project.

(NOTE: At this point, unity might be reporting errors in the tango source code. If so, build the project once File > Build and they should go away)

As with all Unity / Tango apps, you'll need to add the prefab at TangoSDK/Core/Prefabs/Tango Manager to your scene, and take a look at it's components. We only need pose data for this demo, not depth, so leave everything as it is.

Take a look at the DrawingRig object in the root of the scene. All of the drawing logic happens in the Sketchpad.cs script, which is attached to a particle system. The "drawing" is actually a regular old ParticleSystem. The only difference is that Looping, Play on awake, Emission, and Shape are all disabled (Leaving Renderer on).

Note that DrawingRig has a TangoSketchController script on it. This is a copy of TangoSDK/Examples/Scripts/Controllers/SampleController.cs, with a bunch of OnGUI debug info disabled. This script is what takes the latest pose (position + rotation) data from the device and applies it to the game object.

The actual drawing logic, in Sketchpad.cs, is fairly standard unity code. Here's how it works:

  • Listen for mouse events
  • Project a ray onto the InvisibleCanvas plane that is attached to DrawingRig
  • Create a bunch of new points from the last point to the new point
  • Update the ParticleSystem with the latest points

Check out the source of Sketchpad.cs for more detail.

space-sketchr's People

Contributors

elee-lfl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.