Skip to content

Commit 8b63f25

Browse files
Post publish fixes
1 parent f35e32e commit 8b63f25

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
basicEffect.LightingEnabled = true;
2+
if (basicEffect.LightingEnabled)
3+
{
4+
basicEffect.DirectionalLight0.Enabled = true; // enable each light individually
5+
if (basicEffect.DirectionalLight0.Enabled)
6+
{
7+
// x direction
8+
basicEffect.DirectionalLight0.DiffuseColor = new Vector3(1, 0, 0); // range is 0 to 1
9+
basicEffect.DirectionalLight0.Direction = Vector3.Normalize(new Vector3(-1, 0, 0));
10+
// points from the light to the origin of the scene
11+
basicEffect.DirectionalLight0.SpecularColor = Vector3.One;
12+
}
13+
14+
basicEffect.DirectionalLight1.Enabled = true;
15+
if (basicEffect.DirectionalLight1.Enabled)
16+
{
17+
// y direction
18+
basicEffect.DirectionalLight1.DiffuseColor = new Vector3(0, 0.75f, 0);
19+
basicEffect.DirectionalLight1.Direction = Vector3.Normalize(new Vector3(0, -1, 0));
20+
basicEffect.DirectionalLight1.SpecularColor = Vector3.One;
21+
}
22+
23+
basicEffect.DirectionalLight2.Enabled = true;
24+
if (basicEffect.DirectionalLight2.Enabled)
25+
{
26+
// z direction
27+
basicEffect.DirectionalLight2.DiffuseColor = new Vector3(0, 0, 0.5f);
28+
basicEffect.DirectionalLight2.Direction = Vector3.Normalize(new Vector3(0, 0, -1));
29+
basicEffect.DirectionalLight2.SpecularColor = Vector3.One;
30+
}
31+
}

Diff for: articles/getting_to_know/howto/graphics/index.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ This section walks through several core concepts related 3D rendering and math p
129129

130130
### 3D Collisions
131131

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

134-
Collision detection determines whether objects in a game world overlap each other.
134+
Collision detection determines whether objects in a game world overlap each other.
135135

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

138-
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.
138+
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.
139139

140-
[Testing for Collisions](HowTo_Test_for_Collisions.md)
140+
- [Testing for Collisions](HowTo_Test_for_Collisions.md)
141141

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

0 commit comments

Comments
 (0)