diff options
| author | victorfisac <victorfisac@gmail.com> | 2016-05-21 18:10:06 +0200 |
|---|---|---|
| committer | victorfisac <victorfisac@gmail.com> | 2016-05-21 18:10:06 +0200 |
| commit | 30941c0dd1f7904b5a0b50c05ec17265f8d69baa (patch) | |
| tree | 1ac18258e2837f80ed4ebb1ebdeb814e6e887679 /src | |
| parent | cf71e1242e593de5b77d6ff219569e8c0d2c7fd9 (diff) | |
| download | raylib-30941c0dd1f7904b5a0b50c05ec17265f8d69baa.tar.gz raylib-30941c0dd1f7904b5a0b50c05ec17265f8d69baa.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/models.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/models.c b/src/models.c index 2629dffd..aef79626 100644 --- a/src/models.c +++ b/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. { |
