fix: 3D Visualizer mirroring model
This commit is contained in:
parent
7b25d97ea2
commit
69bdebeb98
@ -31,6 +31,6 @@ mat4 viewMatrix(vec3 rotation) {
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
mat4 view = viewMatrix(rotation);
|
mat4 view = viewMatrix(rotation);
|
||||||
normal = (vec4(in_Normal, 1.0) * view).xyz;
|
normal = (vec4(in_Normal, 1.0) * view).xyz * -1;
|
||||||
gl_Position = vec4((in_Position + translation) * scale, 1.0) * view;
|
gl_Position = vec4((in_Position + translation) * -scale, 1.0) * view;
|
||||||
}
|
}
|
@ -296,7 +296,6 @@ namespace hex::plugin::builtin {
|
|||||||
frameBuffer.bind();
|
frameBuffer.bind();
|
||||||
|
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
glEnable(GL_DEPTH_CLAMP);
|
|
||||||
|
|
||||||
shader.bind();
|
shader.bind();
|
||||||
shader.setUniform("scale", scaling);
|
shader.setUniform("scale", scaling);
|
||||||
@ -308,9 +307,6 @@ namespace hex::plugin::builtin {
|
|||||||
glViewport(0, 0, renderTexture.getWidth(), renderTexture.getHeight());
|
glViewport(0, 0, renderTexture.getWidth(), renderTexture.getHeight());
|
||||||
glClearColor(0.00F, 0.00F, 0.00F, 0.00f);
|
glClearColor(0.00F, 0.00F, 0.00F, 0.00f);
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
glMatrixMode(GL_PROJECTION);
|
|
||||||
glLoadIdentity();
|
|
||||||
glFrustum(-1.0F, 1.0F, -1.0F, 1.0F, 0.0000001F, 10000000.0F);
|
|
||||||
|
|
||||||
if (indices.empty())
|
if (indices.empty())
|
||||||
vertexBuffer.draw();
|
vertexBuffer.draw();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user