PDA

View Full Version : Front Projection with Nodes



pooby
06-25-2007, 02:13 AM
Hi,

Does anyone know of a way of doing Front Projection with nodes?

I'll tell you what I'm trying to achieve, and what's wrong with the layer version of front projection.


I want to be able to project some moving footage onto an object, and morph the object, distorting the footage.
In the layer version, you cannot use a morph (or any displacement) to distort the footage.. It's literally like projecting footage from a projector, so will always stay undistorted.

I am hoping that there is a way to do this with Nodes.

(I have a convoluted and not ideal workaround using surface baker and a UV map, but I think this 'should' be possible without it)

Red_Oddity
06-25-2007, 02:35 AM
I have tried something similar using the raytrace and spot node...
but for some reason is could not get my head around the math the make it fit the projection i wanted
it did work though.

I'll try to find it.

dpont
06-25-2007, 02:53 AM
I have posted this, before:
http://www.newtek.com/forums/showthread.php?t=63417#4
My be this could help,
Front and Move node are included in DP Kit.

Denis.

pooby
06-25-2007, 04:25 AM
Thanks for the replies.

I have just been playing with the DP kit, but I can't get the front projection to stick onto and be warped by the morph.
I don't fully understand that tree you linked to Denis. My experience of nodes so far has been rather basic compared to this.

any further explanation would be gratefully recieved.

jameswillmott
06-25-2007, 05:14 AM
Pooby, can you build a UV map, then use the Surface Baker to bake the front porjection image into the UV map?

I understand what you are trying to do, but haven't found any other way (apart from baking) to do it...

dpont
06-25-2007, 05:35 AM
With this node tree you have regular front projection
(which matches image background), then if you want
to morph the object the image mapped on the surface
is warped.
47519

You can use Image node instead of Layer node, with
a default planar image mapping.

Denis.

dpont
06-25-2007, 05:51 AM
...But it doen't wrap properly this way.

Denis.

dpont
06-25-2007, 06:08 AM
May be this one,
more understandable:
47523
the result on a quad with a simple endormorph:
47522

The Color Layer is directly set to Image and Front projection,
then a spot moving/displacement (Spot Object - Spot World)
is applied through the Move node.
Move node has World Coordinates checked.

Denis.

pooby
06-25-2007, 07:30 AM
Pooby, can you build a UV map, then use the Surface Baker to bake the front porjection image into the UV map?

I understand what you are trying to do, but haven't found any other way (apart from baking) to do it...

Yes, this is what I've been doing until now, but if you move from far out to close in on the object, you need a massively hi-res texture map, or it loses detail.

I'll try these other methods.. I'll be very excited if this works

pooby
06-25-2007, 08:05 AM
Thanks Denis, It will morph, but it doesnt respect the front projection. It changes it to a sort of planar. If the camera moves about, the front projection isn't 'live' any more.

What I really need is to project the image from the camera, but be able to warp the object, and whatever is projected onto that will warp with the geometry.
Ie.. you film a walkaround of a house. Track the shot, make some geometry in the position the house is in.
Front project the footage onto the house, and morph the house. So you end up with a morphed live action house.
It works if you surface bake it, (with the above caveats) but I'd love to get it working without that extra step.

dpont
06-25-2007, 08:15 AM
Ok, will test what you say,
but sure if you move the camera, the above
node tree is not enough, the delta (world - local)
is for a static scene with only warping (or any object
transformation), with animated camera the delta should
be transformed with the camera info.

Denis.

dpont
06-25-2007, 08:32 AM
In fact this node tree respects the Front projection,
in this sample only the half top of the square is morphed,
as you can see in wireframe and the camera is moved
and rotated, the half bottom of square matches the
background.
4753747538

But this displacement is mainly 2D, if you do true 3D
displacement the delta vector should be adjusted with
the camera.

Denis.

dpont
06-25-2007, 09:14 AM
Here is the "footage" (a simple ball and an animated camera):
47540

And here is the front projection of the above sequence
with my node tree (no camera transformation) and
a endomorph applied to the ball:
47541

Denis.

pooby
06-25-2007, 11:13 AM
I appreciate your help Denis,

Does it mean that it can't be done with a moving camera then? or is there some way of doing the extra warping necessary?

dpont
06-25-2007, 11:28 AM
In my sample the front camera is matching exactly
the camera "footage", so if you use a real footage,
you need some tracked camera motion.

Sure there are some other limitations with
the displacement if it shows unmapped sides
of the geometry.


Denis.

pooby
06-25-2007, 03:21 PM
But I thought you said the camera isn't moving in the second one? (no camera transformation) I'm a bit confused.

Is it using the same setup as I tried earlier?

dpont
06-26-2007, 01:25 AM
Sorry for confusion, the front projection scene is exactly
the same than the "footage", so yes the camera is still moving,
I have only replaced the 2D bricks texture on the ball by the front
node tree and added the Morph Mixer for the displacement of the ball.
I meaned "no camera transformation" needed in the node tree for
correcting the delta (world - local) input in move.

So the node tree is an Image Map with the footage sequence
set to Front Projection, its color is input in the Move node,
and the Spot world substracted by the Spot Object is
connected in Move scalar of the Move node, that's all.

But as I said, the displacement lets see some
back sides of the ball...

Denis.

pooby
06-26-2007, 03:35 AM
Hi Denis,

Thanks.. It does work as long as the object is not moved.. Even though it would be nice if you COULD move the object and it still work, I think this method is still better overall than the suface baking-sequence-saving-reloading-re texture assigning workaround I was doing before.

Thanks a lot.

dpont
06-26-2007, 05:12 AM
Theorically, object can be moved, rotated, displaced
except the limitation with back side (non-mapped in footage)
of the object.
Here the "footage" a ball and a moving camera:
47585

Here, the front projection with same moving camera,
object is displaced, moved, rotated (mainly in "bank")
(in a few frames a bit of background of the footage
is mapped on the sphere):
47586

Denis.

pooby
06-26-2007, 08:44 AM
What I mean is, if you move the Object, it will shift the front projection in the same way as morphing will.
You can't move the object into postion and have just the morphing affect the warping of the footage.
It just means that the object has to be postioned correctly to the footage in modeller rather than tweaking it in layout. (or use save transformed)
But it's not a big deal. Thanks again for your help.

actually.. I wonder If I reset the pivot, whether that will fool it into thinking its at 0-0-0

dpont
06-26-2007, 10:18 AM
I your object is centered in Modeler,
move it in the camera view in layout
to match its location in footage.
In node tree add another Math Vector
Substract node to substract the location
of the object to the "World-Local", but
set the position in the node panel,
do not enter its Item Info position because
it could vary with time and we need only
its matched position.

Denis.

pooby
06-27-2007, 05:27 AM
So it is possible? this is getting better..

I'm sorry though. I don't understand how to do what you suggest.. I've tried variations on your suggestion, but I think I need it spelt out to me.
When it comes to nodes, I'm afraid I'm not really understanding all the spot info etc, I just grasp the basics at present.

what would happen if you rotate it?

dpont
06-27-2007, 05:59 AM
For the object moved for mathing the footage,
You set the object position in the panel of the
second Substract node:
47629

If the object is also rotated then the above doesn't
work, you need to substract the position but transformed
by the object rotation at time zero, since the current
Item Info node is updated by time you should use
the Item Info included in DP Kit, in the panel select
"Absolute" and time = 0.0, then transform the position
as described below (not tested...)
47630

(a bit more complicated...)

Denis.

pooby
11-19-2007, 04:12 PM
(months later) I feel bad that I didn't say a final thanks to Denis, so take this as one.