Skip to content

Commit 399466c

Browse files
Responding to feedback, sample also moved to MonoGame.Samples repo
1 parent c81f1df commit 399466c

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

articles/getting_to_know/howto/graphics/camera/HowTo_Understand_Different_Camera_Modes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ These are the kinds of camera modes demonstrated in this sample:
2727

2828
## Sample
2929

30-
As the sample is quite large and contains several pieces of content for the demonstration, it is provided as a download here:
30+
As the sample is quite large and contains several pieces of content for the demonstration, the full source is available here:
3131

32-
### [Basic Camera Example](../files/BasicCameraExample.zip)
32+
### [Basic Camera Example Source](https://github.com/MonoGame/MonoGame.Samples/tree/3.8.2/Tutorials/BasicCameraExample)
3333

3434
## Understanding the different camera modes
3535

Binary file not shown.

articles/getting_to_know/whatis/graphics/WhatIs_Camera.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,30 @@ The functionality does provide some techniques to sort what is drawn, provide so
9191

9292
When drawing 3D content in a scene, the Camera's current `View` and `Projection` are what are fed in to an [Effect](xref:Microsoft.Xna.Framework.Graphics.Effect) that draws the 3D content, together with a [Transformational Matrix](../../howto/graphics/HowTo_TransformPoint.md) (`World` position and rotation of the model) multiplied by the same `World` matrix used by the camera (as they are both part of the same world).
9393

94-
An Example model drawing method:
94+
The MonoGame `Model` class has a built in `Draw` Method which performs the basic functions needed in order to render a 3D model into the view, requiring only the `World`, `View`, and `Projection` matrices required to draw it, as follows:
95+
96+
```csharp
97+
Model myModel;
98+
99+
protected override void LoadContent()
100+
{
101+
myModel = Content.Load<Model>("<model file name>");
102+
}
103+
104+
protected override void Draw(GameTime gameTime)
105+
{
106+
GraphicsDevice.Clear(Color.CornflowerBlue);
107+
108+
// Ground drawn from the center of the scene
109+
myModel.Draw(Matrix.Identity, currentCameraView, currentCameraProjection);
110+
}
111+
112+
```
113+
114+
> [!INFO]
115+
> For information purposes only
116+
117+
Behind the scenes, the `model.Draw()` method is using a `BasicEffect` and performing the necessary matrix calculations to position and render the model, as follows:
95118

96119
```csharp
97120
/// <summary>

0 commit comments

Comments
 (0)