# Using processing for the HTC Vive

**URL:** <https://discourse.processing.org/t/using-processing-for-the-htc-vive/5764>\
**Category:** Libraries\
**Created:** [November 20, 2018, 2:32pm UTC](https://discourse.processing.org/t/using-processing-for-the-htc-vive/5764 "2018-11-20T14:32:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![donzilll](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@donzilll](https://discourse.processing.org/u/donzilll)\
**Post date:** [November 20, 2018, 2:32pm UTC](https://discourse.processing.org/t/using-processing-for-the-htc-vive/5764/1 "2018-11-20T14:32:17Z")

</div>

Hello everyone,

I have a HTC Vive and am interested in creating processing sketches to use in VR.  
I found a great library that does exactly that:

> **[Use Your HTC Vive With Processing!](https://www.instructables.com/id/Use-Your-HTC-Vive-With-Processing/)**
>
> Use Your HTC Vive With Processing!: This guide will show you how to add a library Processing that will enable you to use your HTC Vive with Processing so you can view and interact with your sketches in Virtual Reality! It will also cover how to...

  
It has been great so far but I found have found it be quite limited with a lot less code than I would have expected.  
What I want to do in the HTC Vive is to use a barrel distortion so I can fix the pincushion distortion vr devices have. Here is a link to what I mean:  
[http://msl.cs.uiuc.edu/vr/node208.html](http://msl.cs.uiuc.edu/vr/node208.html)  
And a solution to lens distortion:  

> **[Three approaches to VR lens distortion](https://smus.com/vr-lens-distortion/)**
>
> Immersion requires a large field of view. This could be achieved by putting a large curved spherical display on your face, but alas such technology is prohibitively expensive. A more affordable solution to increasing the field of view is to look at...

I have found another library that uses the barrel distortion - Camera3D

> **[Barrel Distortion](https://ixora.io/projects/camera-3D/barrel-distortion/)**
>
> Processing - Camera3D library - Barrel Distortion generator

  

> <https://github.com/hx2A/Camera3D/blob/master/src/camera3D/generators/BarrelDistortionGenerator.java>

  
However this can only be used for the Oculus Rift and Google cardboard, and both Camera3D and Vive.p5 librarys wont work together as they both need to control the camera.

So from what I have researched this problem has not been done on the HTC Vive yet in processing.  
I am not an expert in processing so any help or direction on how to implement this barrel distortion would be great!

I also found the display code for the HTC Vive, which may help:

> <https://github.com/OSVR/OSVR-Vive/blob/master/displays/HTC_Vive.json>

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [November 20, 2018, 7:55pm UTC](https://discourse.processing.org/t/using-processing-for-the-htc-vive/5764/2 "2018-11-20T19:55:56Z")

</div>

If you post your question to multiple sites, please link between the posts.

This question has also been asked here:

> <https://stackoverflow.com/questions/53395887/what-is-the-correct-htc-vive-barrel-distortion-radius-function>
