Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

HTC Vive Development Environment

Helpful techniques for working with TouchDesigner. Answers only, no questions.

Re: HTC Vive Development Environment

Postby jarrett » Mon Feb 20, 2017 6:53 pm

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
______________________
Jarrett Smith
Derivative
User avatar
jarrett
Staff
 
Posts: 70
Joined: Tue Nov 13, 2007 1:12 am
Location: Los Angeles

Re: HTC Vive Development Environment

Postby anodin » Tue Feb 28, 2017 5:13 pm

Really Nice.
It help me to create teleport mode.
Cheers
anodin
 
Posts: 165
Joined: Tue Jun 21, 2011 4:40 pm
Location: Montreal

Re: HTC Vive Development Environment

Postby jarrett » Thu Mar 02, 2017 3:48 pm

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: Select all
"""
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)




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...

https://www.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
______________________
Jarrett Smith
Derivative
User avatar
jarrett
Staff
 
Posts: 70
Joined: Tue Nov 13, 2007 1:12 am
Location: Los Angeles

Re: HTC Vive Development Environment

Postby stev_fun » Tue Apr 11, 2017 11:27 am

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
stev_fun
 
Posts: 22
Joined: Fri Apr 17, 2015 1:21 pm

Re: HTC Vive Development Environment

Postby jarrett » Tue Apr 11, 2017 3:24 pm

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.

Code: Select all
   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...

https://www.dropbox.com/pri/get/ViveDev ... iOH7jt8sQw

or try...

https://drive.google.com/file/d/0B9u7wA ... sp=sharing
______________________
Jarrett Smith
Derivative
User avatar
jarrett
Staff
 
Posts: 70
Joined: Tue Nov 13, 2007 1:12 am
Location: Los Angeles

Re: HTC Vive Development Environment

Postby michela » Thu Apr 13, 2017 7:56 pm

Jarrett, neither dropbox links above not working for me, even after signing into Dropbox. Can you check v4 link?
michela
 
Posts: 155
Joined: Tue Jan 10, 2012 11:51 pm
Location: Sydney

Re: HTC Vive Development Environment

Postby karunakaruna » Wed Apr 19, 2017 7:58 pm

Second that! Would love to try this out but it appears the link is broken.
karunakaruna
 
Posts: 1
Joined: Fri Oct 14, 2016 11:22 pm

Re: HTC Vive Development Environment

Postby jarrett » Thu Apr 20, 2017 9:03 pm

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

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

J
______________________
Jarrett Smith
Derivative
User avatar
jarrett
Staff
 
Posts: 70
Joined: Tue Nov 13, 2007 1:12 am
Location: Los Angeles

Previous

Return to Techniques

Who is online

Users browsing this forum: No registered users and 2 guests