Cameron Lowell Palmer
Cameron Lowell Palmer

Reputation: 22235

SCNShadable get transformed vertex

Within SCNShadable it is straightforward to get the u_modelViewTransform matrix, but how do you correctly get the current vertex position after transform?

float4 position = u_modelViewTransform * _geometry.position;

The error

program_source:443:19: error: use of undeclared identifier 'u_modelViewTransform' float4 position = u_modelViewTransform * _geometry.position;

A bit more detail

I'm specifically, trying to get the plane equation of an SCNPlane this way, so maybe this is the wrong way to go?

Upvotes: 0

Views: 295

Answers (1)

mnuages
mnuages

Reputation: 13462

you should have access to _geometry.position where _geometry is of type SCNShaderGeometry (the documentation for SCNShaderModifierEntryPointGeometry)

Upvotes: 1

Related Questions