Skip to content

Commit

Permalink
Post publish fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDarksideJ authored Sep 8, 2024
1 parent f35e32e commit 8b63f25
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
basicEffect.LightingEnabled = true;
if (basicEffect.LightingEnabled)
{
basicEffect.DirectionalLight0.Enabled = true; // enable each light individually
if (basicEffect.DirectionalLight0.Enabled)
{
// x direction
basicEffect.DirectionalLight0.DiffuseColor = new Vector3(1, 0, 0); // range is 0 to 1
basicEffect.DirectionalLight0.Direction = Vector3.Normalize(new Vector3(-1, 0, 0));
// points from the light to the origin of the scene
basicEffect.DirectionalLight0.SpecularColor = Vector3.One;
}

basicEffect.DirectionalLight1.Enabled = true;
if (basicEffect.DirectionalLight1.Enabled)
{
// y direction
basicEffect.DirectionalLight1.DiffuseColor = new Vector3(0, 0.75f, 0);
basicEffect.DirectionalLight1.Direction = Vector3.Normalize(new Vector3(0, -1, 0));
basicEffect.DirectionalLight1.SpecularColor = Vector3.One;
}

basicEffect.DirectionalLight2.Enabled = true;
if (basicEffect.DirectionalLight2.Enabled)
{
// z direction
basicEffect.DirectionalLight2.DiffuseColor = new Vector3(0, 0, 0.5f);
basicEffect.DirectionalLight2.Direction = Vector3.Normalize(new Vector3(0, 0, -1));
basicEffect.DirectionalLight2.SpecularColor = Vector3.One;
}
}
12 changes: 6 additions & 6 deletions articles/getting_to_know/howto/graphics/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@ This section walks through several core concepts related 3D rendering and math p

### 3D Collisions

[Bounding Volumes and Collisions](../HowTo_CollisionDetectionOverview.md)
- [Bounding Volumes and Collisions](../HowTo_CollisionDetectionOverview.md)

Collision detection determines whether objects in a game world overlap each other.
Collision detection determines whether objects in a game world overlap each other.

[Selecting an Object with a Mouse](HowTo_Select_an_Object_with_a_Mouse.md)
- [Selecting an Object with a Mouse](HowTo_Select_an_Object_with_a_Mouse.md)

Demonstrates how to check whether the mouse is positioned over a 3D object by creating a ray starting at the camera's near clipping plane and ending at its far clipping plane.
Demonstrates how to check whether the mouse is positioned over a 3D object by creating a ray starting at the camera's near clipping plane and ending at its far clipping plane.

[Testing for Collisions](HowTo_Test_for_Collisions.md)
- [Testing for Collisions](HowTo_Test_for_Collisions.md)

Demonstrates how to use the BoundingSphere class to check whether two models are colliding.
Demonstrates how to use the BoundingSphere class to check whether two models are colliding.

0 comments on commit 8b63f25

Please sign in to comment.