Developed a Virtual Reality racing app, incorporating 3D physics and immersive gameplay to create an engaging and interactive driving experience.
Concept:
Developed a Mixed Reality (MR) drawing and erasing application that allows users to create and manipulate virtual drawings within their real-world environment. By using controllers, users can draw in 3D space and intuitively erase their creations.
Technical:
Dynamic Drawing Mechanism
Implemented a system that enables users to draw in MR by instantiating virtual "dots" at the positions of the controller's edges when the user presses the index triggers. This feature allows for real-time creation of 3D drawings that mirror the user's hand movements, providing a seamless drawing experience.
1public class AppManagerScript : MonoBehaviour
2{
3 public GameObject TheDotL; // The prefab for the left hand drawing dot
4 public GameObject TheLeftEdge; // Reference point on the controller
5 private bool FirstDrawL = true; // To control drawing initiation
6
7 void Update()
8 {
9 // Left hand drawing
10 if (OVRInput.Get(OVRInput.RawAxis1D.LIndexTrigger) > 0 && FirstDrawL)
11 {
12 FirstDrawL = false;
13 // Instantiate a dot at the left edge position
14 GameObject CurrentLeft = Instantiate(TheDotL, TheLeftEdge.transform.position, TheLeftEdge.transform.rotation);
15 FirstDrawL = true;
16 }
17
18 // Similar implementation for the right hand...
19 }
20}
21
AppManagerScript
detects when the user presses the left index trigger. It then instantiates a new drawing dot (TheDotL
) at the position and orientation of TheLeftEdge
, which is a reference point on the controller. This mechanism captures the user's drawing motions in real time.Intuitive Erasing Functionality
Created an erasing mechanism where users can erase parts of their drawing by activating an eraser object when pressing the hand triggers. When the eraser collides with drawn objects, it removes them from the scene, allowing users to easily modify or correct their creations.
1public class EraseMeScript : MonoBehaviour
2{
3 void OnTriggerEnter(Collider WhatHit)
4 {
5 if (WhatHit.gameObject.CompareTag("eraser"))
6 {
7 Destroy(this.gameObject); // Erase the drawing object
8 }
9 }
10}
11
EraseMeScript
is attached to each drawing object. It listens for collisions with any object tagged as "eraser". When a collision is detected, it destroys the drawing object, effectively erasing it from the scene. This provides a natural and intuitive erasing interaction for the user.Impact