Draw boxes instances for objects tracking

Hi everyone!

This is my first post here :slight_smile:

I would like a suggestion about how to achieve this kind of drawing in TouchDesigner:

image

I’m not interested in the objects tracking part, I’ve already the list of all the boxes per frame.

What kind of approach you would use to manage this kind of visualization?

I thought using a geometry comp but what stops me is that I would like to obtain without using a 3D environment with a camera and other stuff,

Thanks for any suggestions.

Welcome to the forums!

The easiest way to do it without using a 3D scene would just be to use a series of Rectangle TOPs. They can overlay a rectangle outline over the input image entirely in 2D.

If you’ve got a relatively small fixed number of rectangles, then you could just manually create a top for each one. If you want to get a little fancier, you could use a Replicator COMP to dynamically create a Rectangle TOP for each of your boxes based on the data in a table.

I’d recommend checking out the Operator Snippets to see some examples of how both of those nodes work.

1 Like

it seems I found the solution, although I had forgotten about this discussion from two years ago. The solution involves working within a 3D environment. To achieve this:

  1. Create an Orthographic Camera.
  2. Set the Orthographic Width to 1.
  3. Adjust the Y Scale to match the proportion of resx / resy.
  4. Create a render with dimensions that correspond to input image

Then instance the rectangle from a table or chop, and set the material to LineMat or Wireframe Mat (remember to select Topology Wire Frame from Wireframe mode )