Code Monkey home page Code Monkey logo

draw-note-unity-hololens-2-sprint's Introduction

Draw-Note-Unity-Hololens-2-Sprint

C#, Unity, HoloLens 2, AR, MRTK2, HoloLens 2 Emulator

Disclaimer: Not yet tested on a HoloLens 2 (and needs changes. Postmortem coming soon.)

Overview:

1 week sprint project for HoloLens 2. Draw lines in Augmented Reality on the Hololens 2 with MRTK2 and a variety of features.

Screenshots:

drawnote5_caption drawnote4_caption drawnote1_caption drawnote2_caption draw_note_poster

^ custom AI created promotional artwork for Draw Note

Controls:

The controls in Draw Note are the regular style of Hololens 2 controls.

While drawing: The User holds out arm in front of their body in a comfortable position. In Normal Mode the drawing will happen just beyond this. The User can move their hand, arm, head, body and look around while continue to draw. Read Drawing Modes later for more details.

There is 3 ways to interact with buttons:

  1. The User's Gaze is directed at the Button from a distance, and then they make the Air Tap gesture (focus gaze then right click in emulator)
  2. The User says the Voice Command associated with the button/action ex. "RED", "DRAW", "STOP"
  3. The User does a nearby hand interaction, by actually pressing the button with their finger

There are two Menus that are context dependant:

  • Small Note Drawing Menu - Is smaller and is active while the User is drawing. It simply directs the user to say "STOP" to stop, and it has a Stop Button
  • Drawing Details Menu - Is larger and is active while the User is not drawing. It contains buttons for input options listed below, except Stop
Voice Command Description
DRAW Start drawing
STOP Stop drawing
MODE Switch drawing mode
UNDO Undo last drawing
CLEAR Clear all drawings
WHITE Set draw color to white
RED Set draw color to red
YELLOW Set draw color to yellow
GREEN Set draw color to green

Drawing Modes:

It's important for the User to understand and switch between the different Drawing Modes to get the expected behavior.

Drawing Modes Description
Normal Draw only on draw plane with hand (Ex. you want to write clearly like on a piece of paper)
Mesh Draw only on meshes with hand (Ex. you want to write on a wall, or floor)
Finger Draw from your finger (Ex. you want to draw a line exactly from your finger position)

Implementation:

drawnote_implementation_diagram

  • User Inputs are interpreted by MRTK2 for the correct environment
  • Some custom configurations are applied directly to MRTK profile (Ex. custom voice inputs)
  • Drawings are stored in an Object with a Unity ParticleTrail component (Each saved node of the instance Drawing requires very little storage)
  • Create new drawing Object when starting to draw, or changing colors for easy Undo layers
  • Menus follow the User and stay within the camera frustum as per Hololens 2 style. They can also be repositioned
  • Unit Tests in Unity Test Runner

Draw Plane description (only relevant while using Normal Mode): Default target drawing distance is 64 centimeters away (approx average human arm length) from the User. DrawPlane GameObject's center is set to 1 meter away with a depth/thickness of 72 centimeters (to more safely catch raycast). It's position and rotation is always set to be that distance and facing the User. So if the User draws directly in the middle of where their looking, that ray would hit the collider at 64 centimeters away.

draw-note-unity-hololens-2-sprint's People

Contributors

yale-winter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

draw-note-unity-hololens-2-sprint's Issues

Assets\AssemblyLister.cs(2,19): error

Hello,
I try to compile your project for my hololens 2, but i have the following error :

-----CompilerOutput:-stdout--exitcode: 1--compilationhadfailure: True--outfile: Temp/Assembly-CSharp.dll
Microsoft (R) Visual C# Compiler version 3.5.0-dev-20359-01 (8da8ba0c)
Copyright (C) Microsoft Corporation. All rights reserved.

Assets\AssemblyLister.cs(2,19): error CS0234: The type or namespace name 'Compilation' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
Assets\AssemblyLister.cs(7,6): error CS0246: The type or namespace name 'MenuItemAttribute' could not be found (are you missing a using directive or an assembly reference?)
Assets\AssemblyLister.cs(7,6): error CS0246: The type or namespace name 'MenuItem' could not be found (are you missing a using directive or an assembly reference?)
-----EndCompilerOutput---------------

do you know a way to correct it ?
build setting :
image

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.