Building Virtual Worlds - 2

The Assignment

For this next assignment, the class was asked to create five (5) interactions that involve switching skyboxes in Unity to reveal a new panoramic image or video.  In addition, other interactions can involve opening and closing information panels, and switching to new scenes. 

The Final Product

Play the video below to see a video captured directly from the headset.


 

The Big Idea

I always wanted to jump into the world of a painting, and I thought this project would be a good way to explore that idea.  The challenge was to create new content on top of an existing painting in order to give it enough visual information to make a seamless 360 degree image.

Below are some images of how I extended two paintings.

Van Gogh's Starry Night

 


 
 
 
 
 

 
A Sunday Afternoon on the Island of La Grande Jatte
Painting by Georges Seurat
 
Seurat had another painting called,"Baigneurs a Asnieres" that also takes place in a park, so I combined the two and created a single large painting.  To make the entire painting cohesive, I needed to find a way to mimic the pointilism technique.  Luckily there was a YouTube tutorial video for that!


 
 
 
 

 

 

 


 

 


 

 

 

 

 

Code

An example of the code for switching skyboxes and triggering audio to play after selecting an image.

"

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
using TMPro;

public class NextImage_Seurat : XRBaseInteractable
{
 public Material Gallery;
    public Material Pointilism;
    bool swap = false;
    public TMP_Text imageswaptext;
    public GameObject Painting;
    public GameObject Easl;
    public GameObject MainTextToHide;
    public GameObject OtherPaintingToHide;
    public GameObject OtherTextToHide;
    public GameObject ExitButton;
     public AudioSource playSound;
     public AudioSource MainGallery;
   


    protected override void OnSelectEntered(SelectEnterEventArgs args)
    {
        base.OnSelectEntered(args);
        Debug.Log("Select Entered");
        if(swap == false){
            RenderSettings.skybox = Pointilism;
            imageswaptext.text = "";
            Painting.SetActive(false);
            Easl.SetActive(false);
            OtherPaintingToHide.SetActive(false);
            OtherTextToHide.SetActive(false);
            MainTextToHide.SetActive(false);
            ExitButton.SetActive(true);  
            playSound.Play();
            MainGallery.Stop();
            swap = true;
        }else{
            RenderSettings.skybox = Gallery;
            imageswaptext.text = "Take a Stroll in the Park";
            Painting.SetActive(true);
            Easl.SetActive(true);
            OtherPaintingToHide.SetActive(true);
            OtherTextToHide.SetActive(true);
             MainTextToHide.SetActive(true);
             ExitButton.SetActive(false);
             playSound.Stop();
           
            swap = false;
        }
       
    }
}


Adding Sound

The class had a little more time to polish the assignment, so I decided to add sound to the experience.  I used the following code to help me figure out what to add to the above script.  

Make sure to create a public "AudioSource" and then use the following function to make it play: playSound.Play();

The main interactions involved:

  • Switching between skyboxes 
  • Creating set actives to hide/reveal GameObjects.
  • Switching Scenes (in order to reset the set actives)
  • Revealing and Hiding information boxes.

Reference

Link to main "Gallery" 360 Image

Video that helped me create the pointillism technique 

 
 

Audio Sources



 



5 Points of Interaction:

All Interaction elements should be customized

  • Minimum 3 Interactors
  • Custom UI Interaction
  • 3D Object Hover Over/Exit State for GameObject
  • UI Canvas Elements
  • Hover/Select/Activate Interactions
  • Interaction Examples
  • Information panels
  • Change Image/Video Background