An augmented reality drawing environment
David J. Lee
- Save and load: save vertex data and allow user to open saved copies of previous sessions
- Save vertex data into userdefaults
- Undo/Redo stacks: Undo drawing of the last curve (or some fixed k most recent vertices), allow redo
- Color Picker: Hue slider
- Add preview color box?
- Popups when tracking quality is bad
- Plane- and straight-line-drawing
- allow user to seed points and display as small SCNSpheres
- continually update view during straight-line drawing with a straight line from the start point to the current point
- Polyline SCNCylinder cleaning
- Remove intermediate points between parallel straight lines (lower angle bound)
- Insert intermediate points between sharp turns (upper angle bound)
- Splines
- abstract implementation (Bezier)
- conversion from polylines to splines and back
- allow vector-drawing using Bezier in 3D
- Shared environment
Users select a brush stroke and move their phones around in 3D space to draw 3D brush strokes. The resulting strokes are suspended in 3D space at a fixed location determined at the time of drawing, although the world space may be translated if the user desires.
- Sculpting features
- Allow user to warp existing vertices with vertex-editing tools (bulge and contract)
- Symmetry mode: symmetry across a given fixed plane (fixed relative to phone or some arbitrary start point)
- Chaos/Jackson-Pollock mode: brush size and color randomly change
- Players view a simple white room with player stand-ins tracked to iPhone motion
- Guesses are submitted and checked via text input or voice recognition
- User can draw strokes in their view
- Holding a finger on the phone screen and moving the phone in 3D space draws 3D strokes where points along the curve correspond to the path of the phone
- User can customize their stroke color, thickness, and brush type
Lots of UI/visual tests
- place finger on screen (hold down)
- move phone around in 3D space while keeping finger held down
- remove finger from screen
- use the phone as a window into the AR scene
- verify that points have been seeded in the appropriate positions relative to real space
- verify that motion along x, y, and z axes produces expected data (NSLog)
- rotation of cylinders uses quaternion defined by angle phi and rotation axis vector w:
- ensure w is a unit vector
- ensure w is oriented in the right direction ('Pokeball' test: seed sphere geometries at the head and tail of w, differentiating the two by using different colors)
- Ensure the following:
- mesh line not invisible
- try making geometry's
isDoubleSided
property true and test again
- try making geometry's
- drawing increases vertex and polygon counts within a reasonable bound (doesn't add nothing or too much)
- no obvious warping effects
- mesh line not invisible
- place nodes with spheres (
pointNode
s) at each vertex and verify that vertices are in the right place ('Atom' test)
- try adjusting slider settings and verify that output works appropriately (intuitive outputs)
- swapping settings doesn't break things
- try various combinations of swaps
- drawing line works
- line segments (cylinders) are oriented in the right direction
- no obvious gaps
- drawing flat curve works
- no obvious gaps
- different options don't conflict and behave as expected
- color and thickness meters harmonize; both harmonize with stroke type
- clearing works without too much delay
- view framerate doesn't drop with a small number of objects in view
- polygon and vertex count stays constant when items in view do not change and no items are added (check for addition of invisible geometries)
- hold finger on phone screen
- move phone to a different location in 3D space
- lift finger off screen
- verify that a transparent box has been drawn spanning the starting and ending positions
Main Path
- User holds a finger on her phone screen while moving her phone in 3D space.
- The stroke is drawn in 3D space as a path of points that corresponds to the position of the user's iPhone through the duration of the held touch gesture.
- The user releases her finger from the phone screen. (Continually) The view overlays all existing strokes onto the live camera feed displayed as the background of the app.
Main Path
- User moves her iPhone around in space.
- iPhone tracks motion and keeps 3D objects in the scene fixed in absolute space.
- Spline and Polylines
- Bezier curves
- Basic computer graphics (quaternion rotation)
Spline
s andPolyline
s- Polyline: collection of straight line segments
- Spline: Bezier curves
- Input a Polyline
- Smooth line, define parametrization
PolylineGeometry
(factory)- Drawing canvas: ordered list of lines
[Polyline]
- Lines are ordered by entry time to allow for history tracking
- Fed into view to make 3D cylinders only upon creation/deletion, so arrays are good enough (don't need quick look-up, just some notion of ordering)
- ARSCNView
SCNVector3
s rendered asSCNCylinder
s stored in the view