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:
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()