Skip to content

Experimentation Tutorial

eisclimber edited this page Nov 3, 2024 · 4 revisions

Experimentation Tutorial

This tutorial will lead you through the steps of creating an example scene to teach the workflow for creating projects for building experiments in VR. A finished version of the scene can be found at "Assets/ExPresS XR/Scenes/Experimentation Tutorial Scene.unity" or can be instanced as a template via the menu option "ExPresS XR > Scenes... > Create New Experimentation Tutorial Scene".

Create and Setup Scene

  • Go to "File > New Scene" (Ctrl + N) and select the "Basic (Built In)" Or "Basic (ExPresS XR)" scene template.
  • Click "Create" and save the newly created scene via "File > Save" (Ctrl + S).
  • If the scene does not contain an XR Rig, add one via the GameObject-menu "ExPresSXR Rig - Teleport." You are, of course, free to choose any other rig you like.
  • Add a Skybox to the Scene by going to "Window > Rendering > Lighting", Selecting the "Environment"-tab in the popup, and placing a Skybox-Material into the topmost "Skybox Material" slot. If you do not have one, press the Circle with the dot on the side of the slot, then search and select the "WheatFieldStandUp" material. Close the pop-up.

Room Creation

  • Open the Room Creator via the menu option "ExPresS XR > Rooms... > Room Creator". Create a room with the extents (6, 3, 5) and Material Preset "Experimentation". This will create an experimentation room with dimensions 6m x 3m x 5m (width x height x depth). These dimensions create the same room as calling "ExPresS XR > Rooms... > Create Default Experimentation Room".
  • Add two windows at "Assets/ExPresS XR/Tutorial Assets/Room/Window Sixer Plain.prefab" and set it's position to (2, 1.1, 2.4) and (-2, 1.1, 2.4) intersecting the wall.
  • Open the ProBuilder Window if not already open via the menu option "Tools > ProBuilder > ProBuilder Window". If it is open for symbols should be present in the top-center of the "Scene"-View window as well as another dock-able "ProBuilder"-Window containing operations.
  • Select the ProBuilder's EdgeSelection-Mode (triangle top-center of the "Scene"-View window).
  • On the wall intersecting the window, select one edge, then execute ProBuilder's "Insert Edge Loop"-Operation. This will create an edge wrapping around the room orthogonal to the selected edge. Move the EdgeLoop to intersect the window frame using it's gimbal.
  • Repeat with the other three edges. This will enclose the wall inside the window, with the edges forming a new face, which now must be deleted.
  • Change the ProBuilder's FaceSelection-Mode (triangle top-center of the "Scene"-View window). Select the face and delete it by executing ProBuilder's "Insert Edge Loop"-Operation or simply pressing the Backspace-Button.
  • Repeat for the second window. You do not need to add horizontal EdgeLoops, as the ones from the first window are already placed at the correct height.
  • Switch back to ProBuilder's ObjectSelection-Mode to be able to select GameObjects normally again.

Add Button Quiz

  • Create a simple table by adding a new Cube with Scale (1.2, 1.1, 0.3) at (0, 0.42, 0.39) and assign the material at "Assets/ExPresS XR/Materials/Plain Colors/PlainBrown.mat" to it.
  • Add a ButtonQuiz like the "Uni Triva Quiz" via the GameObject-Menu at "ExPresS XR/Button Quiz/...". If you want to create your own quiz, execute the menu item "ExPresS XR/Button Quiz Setup" and follow the setup instructions.

Add Data Gatherer

  • Add a DataGatherer via the GameObject-Menu "ExPresS XR/Data Gatherer".
  • Select Local as the Data Export Type and change the Local Export Path if desired.
  • As we want to export values after each answer, we won't need to set Input Action Triggers or setup a periodic Export in the DataGatherer.     Instead select the Button Quiz and connect the OnAnswerGiven-Event with the DataGatherer's function ExportNewCsvLine().     This will export a value every time an answer is given.
  • What is left is choosing the data to be exported. As an example, two sets of values will be exported: The position of the head using the value of an InputAction and all information about the quiz by calling a function using DataGatheringBindings:

  - While inspecting the DataGatherer add a new entry to the Input Action Data Bindings by pressing the "+".    Select the Input Action with the name "XRI Head/Position" by pressing the circle with a dot and searching it in the list that pops up.    The value will automatically be exported as its string representation, and the column name will be derived from the name of the input action.   - While inspecting the DataGatherer add a new entry to the Data Bindings by pressing the "+".     Drag the Button Quiz into the Target Object-Slot. Then select "Button Quiz > string GetFullCSVValues" from the now-enabled "Value To Save"-Dropdown.     Choosing this function will automatically fill in a value for the exportColumnName as it returns values for multiple columns at once as described in the Data Gatherer Documentation.

ExPresS XR Wiki

Tutorial Pages

Code Documentation

Clone this wiki locally