space humster

This commit is contained in:
xkamikoo 2021-01-28 21:09:42 +01:00
parent 1f1294c688
commit cfd744b476
9 changed files with 262132 additions and 4 deletions

25
models/space_humster.mtl Normal file
View File

@ -0,0 +1,25 @@
# Blender MTL File: 'uploads_files_927450_space_humster.blend'
# Material Count: 2
newmtl glass
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl humster
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.420000 0.420000 0.420000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
map_Kd textures\\humster_BaseColor.png
map_Ns textures\\humster_Roughness.png
refl textures\\humster_Metallic.png

262099
models/space_humster.obj Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 665 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 939 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 935 KiB

Binary file not shown.

View File

@ -9,7 +9,6 @@ struct PointLight {
#define NR_POINT_LIGHTS 5
uniform vec3 objectColor;
uniform vec3 lightPos;
uniform vec3 cameraPos;
uniform sampler2D colorTexture;
uniform PointLight pointLights[NR_POINT_LIGHTS];
@ -23,7 +22,7 @@ in vec2 vTexCoord;
void main()
{
vec3 fragColor = vec3(0,0,0);
vec4 textureColor = texture2D(colorTexture, -vTexCoord);
vec4 textureColor = texture2D(colorTexture, vTexCoord);
vec4 ambient = vec4(0.1, 0.1, 0.1, 1.0) * textureColor;
vec3 normal = normalize(interpNormal);
for(int i = 0; i < NR_POINT_LIGHTS; i++)

View File

@ -48,7 +48,8 @@ Core::RenderContext shipContext;
//assimp
std::shared_ptr<Model> corvette;
std::vector<Core::RenderContext> corvetteMeshes;
//std::vector<Core::RenderContext> corvetteMeshes;
std::shared_ptr<Model> crewmate;
float cameraAngle = 0;
glm::vec3 cameraPos = glm::vec3(-6, 0, 0);
@ -299,6 +300,9 @@ void renderScene()
drawFromAssimpModel(programTex, corvette, shipModelMatrix, glm::vec3(1));
glm::mat4 crewmateModelMatrix = glm::translate(glm::vec3(0, 1, 1)) * glm::rotate(time/2, glm::vec3(1, 0, 1)) * glm::scale(glm::vec3(0.1));
drawFromAssimpModel(programTex, crewmate, crewmateModelMatrix, glm::vec3(1));
@ -332,6 +336,7 @@ void init()
corvette = std::make_shared<Model>("models/Corvette-F3.obj");
crewmate = std::make_shared<Model>("models/space_humster.obj");
//shipModel = obj::loadModelFromFile("models/spaceship.obj");
sphereModel = obj::loadModelFromFile("models/sphere.obj");
cubeModel = obj::loadModelFromFile("models/cube.obj");
@ -411,7 +416,7 @@ int main(int argc, char** argv)
//to sprawia, że obiekty ukryte przed kamerą nie są renderowane
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
glFrontFace(GL_CW);
// glFrontFace(GL_CW);
glutDisplayFunc(renderScene);
glutIdleFunc(idle);