How do I get mvPosition in Touchdesigner GLSL Material?

I’m attempting to convert some of my WebGL/ThreeJS shaders into TD GLSL Materials but I’m confused with the matrices setup in TD.

I’d like to access mvPosition like in my WebGL vertex shader here:

attribute vec3 position;

uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;

void main() {
    vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);
    gl_PointSize = -mvPosition.z * 0.8;
    
    gl_Position = projectionMatrix * mvPosition;
}

For reference, its based on what I do using THREE.RawShaderMaterial

Thank you!

You’ll want to read up on the documentation here:

What they call the ‘view’ matrix is what we call the ‘cam’. You’ll also want to read about TDDeform() first, which will get your position into world space, and then you’d use the cam matridx to get it into camera space.