Jump to: Board index » General » Fusion

Tracking a 3d object on a 2d video

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

ReneKim

  • Posts: 10
  • Joined: Tue Apr 26, 2022 8:09 pm
  • Location: Denmark
  • Real Name: Rene Kim

Tracking a 3d object on a 2d video

PostWed May 18, 2022 9:42 am

ive made this "setup" taken from another quation i asked.

Converting the screen-space position to a world-space position is tricky. Let's suppose we place the pEmitter at (0,0,0) and put the camera at (0,0,2) with no rotations. That gives something close to the look of the default Smokestack template, but emitting right from the center of the screen. Eventually, we'll want that location to be in the lower-left corner, but first we'll try to determine the relationship between world coordinates and screen coordinates.

It'll be easier to use a small bit of geometry for this instead of the particles, so make a Shape3D node. It should be in Plane mode by default, but the plane is much too big. Set its size to 0.01 and connect it to the Merge3D. If you look at the Renderer3D, it should appear as a tiny white spot.

Move the Camera using the Translate controls in the Transform tab so that the dot is in the lower-left corner of the screen. Try to position it such that you can only see the upper-right quadrant of the Shape.

From here, we know that the camera's current world coordinates are the same as the screen space (0.5, 0.5). If you double the camera's coordinates, you should get the screen position (1,1). To test it, set the Shape3D's X and Y coordinates to double whatever the Camera's are. It should now appear in the upper right when viewed through the Renderer3D.

So now we know that the screen coordinates (1,1) are equivalent to the world X and Y coordinates of wherever the Shape3D is right now. The next thing to do is to find a way to convert a Tracker's screen coordinates into 3d world coordinates.

the ive taken the custom tool and connected point 1 to the offset of the tracker.
soo fare so good. the x/y changes along the track.
know i need to connect

number1 to Shape3D1.Transform3DOp.Translate.X
number 2 to Shape3D1.Transform3DOp.Translate.Y

and setup my node tree as follows.

nodetree ibject .png
nodetree ibject .png (37.46 KiB) Viewed 406 times


and the only thing ive goot is a nice cube withe the video from the tracker running on it,

what am i doing worng ?

have a good one
/renekim
Rig : I8/32Gb/1Tb/gtx1080ti
Offline
User avatar

Bryan Ray

  • Posts: 2484
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: Tracking a 3d object on a 2d video

PostWed May 18, 2022 4:12 pm

You don't want to push your plate through the 3d system. You want to Merge the result from the Renderer3D on top of the plate. Here's a quickie screenshot of a possible flow arrangement:

Capture.JPG
Capture.JPG (258.91 KiB) Viewed 321 times


You'll probably need to open that in another tab to be able to read the tiny text.

I'd provide the nodes themselves, but they're all just at their defaults. I don't have the time to actually set the situation up again this morning, and I don't want to confuse you with a setup that doesn't do anything. :D
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com

Return to Fusion

Who is online

Users browsing this forum: No registered users and 28 guests