HTC Vive Development Environment

Hi Folks,

Over the last year we’ve been experimenting with the HTC Vive VR system. It’s been real fun. Now we’re excited to pass along our development environment so you can get off to a quicker start building your own VR experiences.

Also included is a fairly long guide to understanding how to use the system. Its a little deep but some very important concepts are introduced like parent shortcuts, tags and 3D ray casting / render picking.

This system and documentation is just getting started so please think of it as an alpha release. Post comments and suggestions on this thread and stay tuned for updates as well

Happy Vive-ing everyone :nerd: ,

Jarrett

Get latest version here…

As of June 22 2017 there is an Oculus version of the environment as well.

As of July 6 2018 this system has been added to the TouchDesigner palette as the folder TDVR. This latest component attached here supports both Vive / OpenVR and Oculus. Just set the HMD component and Controllers component to the correct device on the custom parameters.

The zip has a PDF doc inside.
TDVR.zip (2.11 MB)

1 Like

I heard about this this weekend!

teleport!! woohoo!

working great so far.

thanks for doing the dirty work Jarret!

Hey Brandon!

Ha you’re already teleporting! Great news!

Thanks for trying it out. I’ll add some more docs on programming extensions soon.

J

Best Christmas present ever! Looking forward to digging into this over the holidays, will make some of my VR projects in progress much easier to work on.

Hey thanks guys! really helpful and well written guide - thanks for this christmas present!

Hi Jarrett, thanks for sharing this!

I’m working through the environment/documentation and am getting some errors in 2017.2300 when trying to use the environment. When I move down to 2016.5580, there are no problems.

/openVR/world/indController1/eval1
Error: td.AttributeError: ‘td.ParCollection’ object has no attribute ‘Controlcomp1’ Context:/openVR/world

/openVR/world/indController2/eval1
Error: td.AttributeError: ‘td.ParCollection’ object has no attribute ‘Controlcomp2’ Context:/openVR/world

A few notes regarding the documentation:
There is a typo in the “Parent Shortcut” section (on page 22). The text refers to an Execute DAT when Evaluate DAT is intended.

In the “Making VR Compatible Components” section (page 26), we are instructed to import the teapot.tog from the Geo folder, but that folder isn’t in the Zip file.

Question:
Is there a built-in way to reset my location to the origin after teleporting around?


Damn how did you get such a good looking environment in TD?

Hello Vivers,

I have read the comments here and addressed them in the attached file. As well, in this version is a new custom rayCaster camera object that lets you cast a ray from a camera object that is located in the world. This will allow you to more easily support a different controller. Most people wont need it, but its the blue camera wireframe object and you can turn it off by turning off the display of /openVR/world/rayCaster. A few optimizations but otherwise things are the same. This works with version 2017.2300.

The latest version is always found at the top of this thread.

Jarrett

Oh yes L05 - I have added an O option to the controllers menu beside the W workstation mode that will reset you to the origin. I know that menu is pretty lame so I hope someone makes a better one!

J

Hi Jarrett! (John Courte here)

OOB I’m getting an error finding Geo/TeaPot.tog. The project is on a different drive from Touch Designer. Do I need to set an environment variable or something?

cheers,
-John

Hey John!

I think version one was missing the teapot geo. I have updated to ViveDevEnvironment_Rev2.zip. Let me know if you are still having trouble, but I just double checked and all references are relative to the toe file.

J

Really Nice.
It help me to create teleport mode.
Cheers

A small fix to the teapot example object found in /openVR/resources. teapotExample had a bad reference from in the pickGeo COMP to the Callback COMP - it was parent.Sphere and should have been parent.Teapot. As well I added a very simple extension to the teapot called TeapotExt. You can see this extension by right clicking on the teapotExample component and select “Customize Component” from the popup menu.

In the dialog scroll down to the Extension section and press “Edit”. This will open a text editor and will reveal this code…

[code]“”"
Extension classes enhance TouchDesigner component networks with python
functionality. An extension can be accessed via ext.ExtensionClassName from
any operator within the extended component. If the extension is “promoted”, all
its attributes with capitalized names can be accessed directly through the
extended component, e.g. op(‘yourComp’).ExtensionMethod()
“”"

class TeapotExt:
“”"
TeapotExt description
“”"
def init(self, ownerComp):
# The component to which this extension is attached
self.ownerComp = ownerComp

def HandlePick(self, info):
	debug('teapot pick handled', info)

[/code]

I simply added the HandlePick function which is passed the standard info dictionary with all the contextualized controller information.

For those getting deeper into Python I recommend this new doc written by Ivan…

derivative.ca/wiki099/index … t_Examples

It gets into a very interesting extension module that is part of 099 called CallbacksExt. It is a good example that covers why we have standardized on this single “info” dictionary for passing data between components and modules.

Find the latest revision at the top of this thread.

J

Hey Guys,

First, Jarrett, thanks for creating this. It has been super crazy helpful for previz…

I do have one question concerning the elevation of the headset POV. Im finding it hard to locate the control to manage my height. With the built in ‘move-around’ feature, no matter what i do it always resets the z level to be fairly close to null. Would you mind pointing me in the right direction to changing these parameters? Im sure once i find that exact spot that controls this, i can manage to adapt it to my needs.

Thanks again

P.S. love the teleportation platforms

The main offset is applied in the /openVR/openVRHMD/OpenVRHMDExt module. This is the python extension attached to the HDM component…

From the help it says…

The HMD (eyes) are offset from the root transform depending on where you are standing in the safe room. This inverts that offset and puts it into the root pretransform - just working with tx tz for now.

As you can see I wasn’t sure what to do about Y but you have complete control of where you end up after getting to the position you click in world space using this function. Currently this function applies an offset so that you end up standing on the spot you click in world space instead of the VR safe room center.

	def OffsetEyesToRoot(self):
		"""
		The HMD (eyes) are offset from the root transform depending on where you
		are standing in the safe room.  This inverts that offset and puts it 
		into the root pretransform - just working with tx tz for now.
		"""
		es, er, et = self.eyeComp.worldTransform.decompose() 
		eyeP = tdu.Vector(et)

		trigM = self.transformRigComp.worldTransform
		trigs, trigr, trigt = trigM.decompose()
		trigP = tdu.Vector(trigt)

		rs, rr, rt = self.rootComp.worldTransform.decompose()
		rootP = tdu.Vector(rt)

		diffEyeRigP = eyeP-trigP
		height = diffEyeRigP[1] 
		heightP = tdu.Vector(0,height,0)
		diffRootRig = rootP-trigP
		offsetP = ((trigP - eyeP) + heightP) + diffRootRig
		offsetM = tdu.Matrix()
		offsetM.identity()
		offsetM.translate(offsetP)
		self.rootComp.setPreTransform(offsetM)

I added a Height Offset parameter to the openVRHMD component. In this case you will only get the effect of the new height after your next teleport. Let me know if that works ok for you.

Another idea might be to add an elevator mode to the camera dolly that allows for you to set an offset Y so that you can smoothly modify your Y position while walking around and teleporting. That would require a second Y translation to be subtracted before the Offset function is run, and then added back after. Sounds like a good idea actually… I will put that on RFE list but not sure when I can get to it. I encourage others to try to make the cameraDolly / openVRHMD system better though. All the code for each is found in the respective extension module for each component.

Here is version 4…

dropbox.com/pri/get/ViveDev … iOH7jt8sQw

or try…

drive.google.com/file/d/0B9u7wA … sp=sharing

Jarrett, neither dropbox links above not working for me, even after signing into Dropbox. Can you check v4 link?

Second that! Would love to try this out but it appears the link is broken.

Does this work? Sorry posting attachments to this forum is broken for me right now.

drive.google.com/file/d/0B9u7wA … sp=sharing

J

Attention Oculus Users!

We had a chance to make the HTC Vive Dev environment work with the Oculus. The Oculus version has been added to the latest zip archive that appears on the first message of this thread.

The documentation hasn’t been updated and the Vive and Oculus files are not compatible. Hopefully, we will get some time to reconcile both environments to make them work more interchangeably but its enough to get you started.

#VR #Virtual Reality

o-o Jarrett

Hey Jarrett, I am cracking this open again and am noticing that the PDF guide that used to be bundled with the VR environment is no longer included. Is it possible to find this somewhere? It was very helpful in understanding the structure of everything.