Attaching object to camera frustrum


#1

Hello

I’m trying to attach a plane to the camera frustrum, but I don’t see any option in Xpresso to extract the furstrum X and Y positions…
Is there any way to do this?

Thanks
Alex


#2

There was a script from “tcastudio” in the past (2011) called “camPLANEv2 R13”,
which done this nicely. But is was Phyton based!


#3

hi,

without having looked into tcastudios example the camera frustrum is a rather vague term
for me. what confuses me most is that you are referring to 2d coordinates, while both the
camera frustrum and the camera itself are actually 3d objects.

cameras are aligned along their z-axis. so if you want to place an object in the local camera
matrix and offset it along the z-axis by the focus distance f for example you have just to
multiply the camera matrix with the vector(0,0,f).

edit:

an quick example, i also added some nodes to scale fit the plane into the cameras fov.

http://i.imgur.com/6WkgfX4.gif


#4

Hi,

here is my xpresso version of an image plane rig.
You can move the plane in z and the size fits accordingly.
To get the render size/ratio linked to the plane I grabbed a piece of coffee code from the german c4d forum (can`t remember where I got it from).

Markus


#5

Both are nice and useful examples !

If I follow littledevils XP --> I get a different result with the same formula ?!

What´s wrong ?


#6

lol,

a little bigger image would have helped :wink: but i think you typed 0,5 instead of 0.5.


#7

Thanks for the hint!
I typed in a comma (0,5) instead of a point (0.5).

What kind of impact !


#8

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.