aboutsummaryrefslogtreecommitdiff
path: root/src/models.c
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2016-05-30 23:25:18 +0200
committerRay <raysan5@gmail.com>2016-05-30 23:25:18 +0200
commit4b93349db575bedb48b8c13e95d37df1ec694387 (patch)
treeafcb06723fd9d4f4c0ae7b7d3e9a3f30e494ae1f /src/models.c
parentea5b00528b0cb1e5cc1e7169a195b75915c8607a (diff)
parent11cf455fe0d2c956043aa70f7d8256c4a339b430 (diff)
downloadraylib-4b93349db575bedb48b8c13e95d37df1ec694387.tar.gz
raylib-4b93349db575bedb48b8c13e95d37df1ec694387.zip
Merge pull request #122 from victorfisac/develop
Standard Lighting (3/3)
Diffstat (limited to 'src/models.c')
-rw-r--r--src/models.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/models.c b/src/models.c
index 07dee720..092a43fc 100644
--- a/src/models.c
+++ b/src/models.c
@@ -75,6 +75,25 @@ void Draw3DLine(Vector3 startPos, Vector3 endPos, Color color)
rlEnd();
}
+// Draw a circle in 3D world space
+void Draw3DCircle(Vector3 center, float radius, float rotationAngle, Vector3 rotation, Color color)
+{
+ rlPushMatrix();
+ rlTranslatef(center.x, center.y, center.z);
+ rlRotatef(rotationAngle, rotation.x, rotation.y, rotation.z);
+
+ rlBegin(RL_LINES);
+ for (int i = 0; i < 360; i += 10)
+ {
+ rlColor4ub(color.r, color.g, color.b, color.a);
+
+ rlVertex3f(sin(DEG2RAD*i)*radius, cos(DEG2RAD*i)*radius, 0.0f);
+ rlVertex3f(sin(DEG2RAD*(i + 10)) * radius, cos(DEG2RAD*(i + 10)) * radius, 0.0f);
+ }
+ rlEnd();
+ rlPopMatrix();
+}
+
// Draw cube
// NOTE: Cube position is the center position
void DrawCube(Vector3 position, float width, float height, float length, Color color)
@@ -732,12 +751,12 @@ Material LoadDefaultMaterial(void)
//material.texNormal; // NOTE: By default, not set
//material.texSpecular; // NOTE: By default, not set
+ material.colTint = WHITE; // Tint color
material.colDiffuse = WHITE; // Diffuse color
material.colAmbient = WHITE; // Ambient color
material.colSpecular = WHITE; // Specular color
material.glossiness = 100.0f; // Glossiness level
- material.normalDepth = 1.0f; // Normal map depth
return material;
}
@@ -1250,7 +1269,7 @@ void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rota
//Matrix matModel = MatrixMultiply(model.transform, matTransform); // Transform to world-space coordinates
model.transform = MatrixMultiply(MatrixMultiply(matScale, matRotation), matTranslation);
- // model.material.colDiffuse = tint;
+ model.material.colTint = tint;
rlglDrawMesh(model.mesh, model.material, model.transform);
}