소스 검색

Add Draw3DLine function and fixed MLT glossiness import value

In standard shader, material glossiness is a value from 0 to 1000 like
in MLT files. So, it doesn't need to be normalized.
pull/120/head
victorfisac 8 년 전
부모
커밋
30941c0dd1
1개의 변경된 파일11개의 추가작업 그리고 2개의 파일을 삭제
  1. +11
    -2
      src/models.c

+ 11
- 2
src/models.c 파일 보기

@ -65,6 +65,16 @@ static Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize);
// Module Functions Definition
//----------------------------------------------------------------------------------
// Draw a line in 3D world space
void Draw3DLine(Vector3 startPos, Vector3 endPos, Color color)
{
rlBegin(RL_LINES);
rlColor4ub(color.r, color.g, color.b, color.a);
rlVertex3f(startPos.x, startPos.y, startPos.z);
rlVertex3f(endPos.x, endPos.y, endPos.z);
rlEnd();
}
// Draw cube
// NOTE: Cube position is the center position
void DrawCube(Vector3 position, float width, float height, float length, Color color)
@ -2071,8 +2081,7 @@ static Material LoadMTL(const char *fileName)
int shininess = 0;
sscanf(buffer, "Ns %i", &shininess);
// Normalize shininess value to material glossiness attribute
material.glossiness = (float)shininess/1000;
material.glossiness = (float)shininess;
}
else if (buffer[1] == 'i') // Ni int Refraction index.
{

불러오는 중...
취소
저장