当前位置:网站首页>OpenGL job coordinate system

OpenGL job coordinate system

2022-07-07 22:08:00 qq_ fifty-seven million two hundred and fifty-one thousand thre

One 、 Using the model matrix only makes 3 Multiple box rotation ( And the first 1 A box ), And keep the rest of the box still

#version 330 core
layout (location = 0) in vec3 aPos;

layout (location = 2) in vec2 aTexCoord;

out vec2 TexCoord;

uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;


void main()
{
    gl_Position = projection*view*model*vec4(aPos, 1.0);
   
    TexCoord = aTexCoord;
}

 

#version 330 core
out vec4 FragColor;


in vec2 TexCoord;

uniform sampler2D texture1;
uniform sampler2D texture2;

uniform float Nongdu;

void main()
{
   FragColor = mix(texture(texture1, TexCoord), texture(texture2, vec2(1-TexCoord.x, TexCoord.y)), Nongdu);
}

 

#include<iostream>
#define GLEW_STATIC
#include <GL/glew.h>
原网站

版权声明
本文为[qq_ fifty-seven million two hundred and fifty-one thousand thre]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130608249073.html