Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
ahahto's avatar
ahahto
Honored Guest
12 years ago

Rendering to only one camera

Hi,

I would like to use webcam textures, assigning them to plane objects by:



void Start()
{
string camName = WebCamTexture.devices[camnumber].name;
CameraTexture = new WebCamTexture(camName);
CameraTexture.Play ();
renderer.material.mainTexture = CameraTexture;

}



Now, I would like to obtain a stereo view by showing two of these objects separately (from separate webcams). How could I assign them to be shown -- one to left and one to right camera only?

Dragging these objects below CameraRight and CameraLeft doesn't seem to be enought. (Anyway, I don't even know if there would be some better way of doing this altogether!)

2 Replies

Replies have been turned off for this discussion
  • drash's avatar
    drash
    Heroic Explorer
    By making them children of individual cameras, all that is doing is making them appear in 3D space relative to that camera, and doesn't change rendering. It might even be annoying for the user to have something "stuck to their face" as a result (unless that's what you're going for).

    Anyway, to achieve the effect you're looking for you'll need to set up two new layers, one for "Left Eye", and one for "Right Eye", and then just mark what you want to show up only in one eye appropriately. Then on CameraLeft, make it render everything except Right Eye, and on CameraRight, make it render everything except LeftEye.

    Hope that helps.
  • ahahto's avatar
    ahahto
    Honored Guest
    Oh, that was quite simple!
    The point is exactly to "stuck" the picture into user's face, for providing a hud element.