# Help with a VR example (beginner)

**URL:** <https://discourse.processing.org/t/help-with-a-vr-example-beginner/13434>\
**Category:** Processing.py\
**Created:** [August 17, 2019, 4:04pm UTC](https://discourse.processing.org/t/help-with-a-vr-example-beginner/13434 "2019-08-17T16:04:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![proc8888](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@proc8888](https://discourse.processing.org/u/proc8888)\
**Post date:** [August 17, 2019, 4:04pm UTC](https://discourse.processing.org/t/help-with-a-vr-example-beginner/13434/1 "2019-08-17T16:04:48Z")

</div>

I did the following basic test code and created 4 boxes in 3D ‘space’.  
I would like to view this output using my Iphone 7, looking through a Virtual Reality (VR) headset for example, the Google cardboard.  
What code changes do I need to make it VR-enabled and presume I also need to create a file of a special format and transfer it into my Iphone, ready for viewing?  
Much thanks for help / tips.

Here’s the code:

```auto
def setup():
size(500,500,P3D)
translate(width/2, height/2, 0)
background(255)

rotateY(radians(120))    
fill(128) # grey box
drawbox(0,0,0)
fill(255,0,0) # red box
drawbox(150,0,0)
fill(0,255,0) # green box
drawbox(0,150,0)
fill(0,0,255) # blue box
drawbox(0,0,150)

def drawbox(x,y,z):
pushMatrix()
translate (x,y,z)
box(80)
popMatrix()

```

---

<div class="post-metadata">

**Author:** ![proc8888](https://avatars.discourse-cdn.com/v4/letter/p/f19dbf/32.png) [@proc8888](https://discourse.processing.org/u/proc8888)\
**Post date:** [August 18, 2019, 4:13am UTC](https://discourse.processing.org/t/help-with-a-vr-example-beginner/13434/3 "2019-08-18T04:13:51Z")

</div>

I tried importing processing.vr but it says module not found.

I found some info. on the forum and it seems to be for Android instead of IOS.  
Will keep searching for an example in Processing for IOS for Google cardboard.  
(The idea is if this test code works, then I’ll replace it with a more complicated image/scenes as part of my study/research which I’ve created in 2D and currently converting into 3D).  
Thanks for any tips.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [August 18, 2019, 1:52pm UTC](https://discourse.processing.org/t/help-with-a-vr-example-beginner/13434/4 "2019-08-18T13:52:57Z")

</div>

> [@P5.xr - help with pre-alpha testing on new XR library for p5](https://discourse.processing.org/t/p5-xr-help-with-pre-alpha-testing-on-new-xr-library-for-p5/13403):
>
> Hi all! I have been working alongside Vedhant Agarwal (@vedhant) [on a library](https://github.com/stalgiag/p5.xr/blob/master/README.md) that allows you to make any p5 WEBGL sketch work in XR. Currently this is in pre-alpha release, we haven’t released documentation or builds yet, but you can help us know which hardware is and is not working by trying the following on your phone. This is part of a last push leading up to the alpha release which is targeting mid-fall. Try it out: Using a recent version of Chrome or Firefox on a phone, do the following …
