Project camera image on plane

Hi.

I am wondering if there is a way to use the video textures to project a the image of a camera that is not the active camera onto a plane. I found this tutorial http://www.tutorialsforblender3d.com/Game_Engine/VideoTexture/VideoTexture_Mirror_Quick.html but that only works for the active camera. So how would I make it work for other cameras?

Thanks.

hi IAmThisGuy,

That’s the tutorial for mirrors. The tutorial you want is the Render to Texture.

Render to Texture tutorial

Unless you are want to do a mirror for viewport or a 3rd person mouselook. That’s easy enough to do. Just change line 32 and 33 from Mirror.py

from

# get active camera
cam = scene.active_camera

to

# get object list
objList = scene.objects
   
# camera name or whatever the camera name is
camera = "OBCamera"
   
# get camera object
cam = objList[camera]

I didn’t think of that when I wrote the tutorial. I’ll add a optional Property to the code and tutorial to handle that.

Clark

Ok cool. Thanks, I have gotten a lot of use from your tutorials. Guess I just missed that one.

Ok now I’ve got a different question. Is there a way to make it check if the camera exists, and if it does not, display a plain image? My game only has the camera for a bit, then it gets destroyed, and after it is destroyed, or before it is created, I want it to show a picture saying No Signal or something like that.

Edit: I’m using Render to texture.

hi IAmThisGuy,

Sure, you can check to see if a camera exists. And if it is destroyed, display an image.

Take a look at the attached blend. I changed to code to do that. Realize that I did the code in a hurry and there are probably ways to improve it.

I used States. Space bar switches to State Mask Group 2 and starts the render to texture. X key deletes the camera. If there isn’t a camera or it is deleted, the code detects it and returns to State Mask Group 1.

Clark

Attachments

RenderToTexture_CamCheck.blend (449 KB)

Ok sweet. That is perfect for what I want. Thanks so much.