Using Blender does work, but I understand that it disrupts the workflow if you’re building different spheres or want to change vertices. It’d also be cool and educational to do this entirely in Unity.
The code below is from Shanyan Teng. It was made for a video file, but it may be possible to modify it for the live stream. Unfortunately, I don’t understand it right now, though I’ve tested it with video file applications and it does work.
I’ll carve out some time and try it myself in the future.
Just so everyone following this thread is clear, the fix Megan is talking about is to set the x, y, z scale values to negative numbers. Otherwise, the text and other things will appear reversed. This is not implemented in the unitypackage file I shared above. I created another package below with the blender sphere and with the default scale set to -8, -8, -8, so it shows the correct mirroring from the start.
Also, there should be examples of using Unity to project the stream onto the inside of a sphere without using Blender. We should look for an example and publish the results here.
Now with negative values for scale of x, y, z, per @joshappleman’s tip.
Shows newspaper headline to verify that mirroring problem is resolved.
A simple test package is available a few posts above. Though, the problem is probably the driver if your problem is that Unity can’t use the THETA V as a web cam.
If your problem is that the image is mirrored, the above package may help. By mirrored, I mean that the text on a newspaper looks like it does in a mirror. If that is your problem, than the package above will help.
Awesome. Would love to hear about your project if you have a moment.
Right now, I’m trying to figure out the proper height for the THETA V to give a good telepresence experience. I think I’m going to need to adjust the virtual camera height in Unity as well.
telepresence experience sounds very interesting. Maybe it fits well with the idea I am working on.
I am working on a physical sphere with ThetaV inside. Like a inner body experience.
The user can touch the sphere and see him/herself from inside.
Now I am trying to add sound. Do you know how to use the Audio from Theta V?
Here’s a basic script that will recognize the camera. I have not implemented audio yet per the @Nima suggestion. I will try it today. If you successfully add audio to the script below, post the full working example. Thanks.
using UnityEngine;
using System.Collections;
public class webCamDetect : MonoBehaviour
{
string camName;
public const string RICOH_DRIVER_NAME = "RICOH THETA V 4K";
// change to "RICOH THETA V FullHD" for lower resolution
// (and thus smaller data size)
void Start()
{
WebCamDevice[] devices = WebCamTexture.devices;
Debug.Log("Number of web cams connected: " + devices.Length);
for (int i = 0; i < devices.Length; i++)
{
Debug.Log(i + " " + devices[i].name);
if (devices[i].name == RICOH_DRIVER_NAME)
{
camName = devices[i].name;
}
}
Debug.Log("I am using the webcam named " + camName);
if (camName != RICOH_DRIVER_NAME)
{
Debug.Log("ERROR: " + RICOH_DRIVER_NAME +
" not found. Install Ricoh UVC driver 1.0.1 or higher. Make sure your camera is in live streaming mode");
}
Renderer rend = this.GetComponentInChildren<Renderer>();
WebCamTexture mycam = new WebCamTexture();
mycam.deviceName = camName;
rend.material.mainTexture = mycam;
mycam.Play();
}
}
to followup on the discussion between @nima and @Litto
I have the THETA working as a spatial audio microphone inside of Unity
I can play spatial audio on headphones attached to my computer
I can get sound inside of the HTC Vive headset
I have not done precise tests of the orientation of the spatial sound inside the headset
Script for THETA V Live Streaming plus basic audio
using UnityEngine;
using System.Collections;
public class webCamDetect : MonoBehaviour
{
string camName;
public const string RICOH_DRIVER_NAME = "RICOH THETA V 4K";
// change to "RICOH THETA V FullHD" for lower resolution
// (and thus smaller data size)
// Audio
public const int THETA_V_AUDIO_NUMBER = 0;
AudioSource audioSource;
void Start()
{
WebCamDevice[] devices = WebCamTexture.devices;
Debug.Log("Number of web cams connected: " + devices.Length);
for (int i = 0; i < devices.Length; i++)
{
Debug.Log(i + " " + devices[i].name);
if (devices[i].name == RICOH_DRIVER_NAME)
{
camName = devices[i].name;
}
}
Debug.Log("I am using the webcam named " + camName);
if (camName != RICOH_DRIVER_NAME)
{
Debug.Log("ERROR: " + RICOH_DRIVER_NAME +
" not found. Install Ricoh UVC driver 1.0.1 or higher. Make sure your camera is in live streaming mode");
}
Renderer rend = this.GetComponentInChildren<Renderer>();
WebCamTexture mycam = new WebCamTexture();
mycam.deviceName = camName;
rend.material.mainTexture = mycam;
mycam.Play();
// audio
// this section working with HTC Vive, but have not
// verified spatial audio. Maybe try STEAM AUDIO?
// https://valvesoftware.github.io/steam-audio/downloads.html
// It's good enough for telepresence demo right now, but
// I would like to tune the spatial audio
//
audioSource = GetComponent<AudioSource>();
string[] audioDevices = Microphone.devices;
for (int i = 0; i < audioDevices.Length; i++)
{
Debug.Log(i + " " + audioDevices[i]);
}
audioSource.clip = Microphone.Start(audioDevices[THETA_V_AUDIO_NUMBER], true, 10, 44100);
audioSource.loop = true;
while (!(Microphone.GetPosition(null) > 0 )) { }
audioSource.Play();
}
}
Problem is. Performance starts lagging (image) and there is still no audio
See Screenshot!) I did everything the way you did.
I also used “RICOH THETA V FullHD” in the script. still lagging…
Maybe you know what is missing… thx a lot!