I want to contour a plane in TD using xYz values I have from camera-tracked footage…ie from relatively random spots in the footage of a beach.

how would one go about this ? i can import a mesh that sits on these points using Factory Settings excellent importer…

Hi @jellyhorse,

could you illustrate this request a bit - not sure I fully understand.

cheers

Markus

forSnaut.1.toe (5.6 KB)

forSnaut.tox (2.2 KB)

hope these work , couldnt upload file - in data so i hope its included in tox

its rough demo of what i mean, I have 16 good tracked points and can’t get my head around how to extrapolate a roughly good topology from them

I know more data would make for better - but Im just solving the puzzle first !! - and as always have real life stuff i should be doing instead …

another mystery is that the vanishing point for grid always appears lower than footage - in both directions - when footage plays out…

which suggests camera is too low, but near tracks sit good whole way through one minute.

I really appreciate the TD support dynamic - every few months I anxiously try to cross the bridge to Unreal for some task or other - this camera tracking being an example - and it dies a death after some tiny but insurmountable issue that halts all progress and consumes my world !!..so I come on back to Touch and make it work back here !!

cheers

Julian

…and I realise I havent really explained the network !! … basically there is a CHOP with 16 good track points that switchs with a grid - my challenge is to sit this grid on the topology of the 16 good points.

Hi @jellyhorse,

what i have here doesn’t quite look correct but maybe this is due to the outliers in the 16 point data?

I added this script to a Script CHOP with the 16 tracked features as an input:

```
import numpy as np
def onCook(scriptOp):
scriptOp.clear()
input = scriptOp.inputs[0]
tx = input['tx'].vals
ty = input['ty'].vals
tz = input['tz'].vals
# Create a matrix A with the coordinates of the points
A = np.column_stack((tx, ty, np.ones(input.numSamples)))
# Solve the linear equation Ax = b, where x contains the coefficients of the plane equation
coeffs, _, _, _ = np.linalg.lstsq(A, tz, rcond=None)
a, b, c = coeffs
# calculate normal of the plane
normal = np.array([a, b, -1])
normal = normal / np.linalg.norm(normal)
# unit vectors
x_axis = np.array([1, 0, 0])
y_axis = np.array([0, 1, 0])
z_axis = np.array([0, 0, 1])
# calculate angles between normal and unit vectors
angleX = np.arccos(np.dot(normal, x_axis))
angleY = np.arccos(np.dot(normal, y_axis))
angleZ = np.arccos(np.dot(normal, z_axis))
# degrees
angleX = np.degrees(angleX)
angleY = np.degrees(angleY)
angleZ = np.degrees(angleZ)
# assign angles to channels
scriptOp.numSamples = 1
rx = scriptOp.appendChan('rx')
ry = scriptOp.appendChan('ry')
rz = scriptOp.appendChan('rz')
rx.vals = [angleX]
ry.vals = [angleY]
rz.vals = [angleZ]
return
```

If I’m not totally off this should get you the orientation of an approx. plane with all these points.

cheers

Markus

interesting and helpful - thanks !