Hi;
How can I transform object in GHGL?
Transform object in GHGL.gh (6.3 KB)
layout(location = 0) in vec3 _meshVertex;
layout(location = 1) in vec3 _meshNormal;
uniform mat4 _worldToClip;
uniform float x[16];
out vec3 normal;
void main() {
normal = _meshNormal ;
mat3 transform = mat3(x[0], x[4], x[8], // 1 column
x[1], x[5], x[9], // 2 column
x[2], x[6], x[10]); // 3 column
vec3 mpoint = transform * _meshVertex;
gl_Position = _worldToClip * vec4(mpoint, 1.0);
}
GLMeshTransform.gh (6.5 KB)