Parcourir la source

wip tutorial texts

Jorn il y a 3 ans
Parent
commit
08c0bc641f

+ 14 - 5
en/tutorials/csharpintermediate/project-and-unproject.md

@@ -1,8 +1,11 @@
-# Linear Interpolation
-You can find this sample in the tutorial project: **Menu** → **Linear Iterpolation** 
+# Project and Unproject
 
 ## Explanation
-This C# Beginner tutorial covers linear interpolation which is often shortened to 'Lerp'. Sometimes you want to gradually change a value from a start value to a target value. This process is called linear interpolation. Stride exposes several Lerp functions for various types. Among them are Vector2, Vector3 and Vector4.
+This C# Intermediate tutorial covers projecting and unprojecting coordinates from 3D to 2Dd and visa versa. When we want to 'convert' 3D coordinates to a 2D screen, we speak 'Projecting'. The other way around is called 'Unprojecting'. Both scenarios are fairly common in 3D games. 
+
+The 3D to 2D or projecting happens for instance when you have 3d quest marker. When the target you need to travel to is somewhere in front of you in the word, then you want to draw a 2D quest marker on screen that gives you an indication of where in the 3D world that target is located.    
+
+From 2D to 3D is often used to convert a mouse coordinate in to the looking direction of the camera. This can used for firing a weapon or setting a target on a map when playing a strategy game.
 
 ![Linear interpolation](media/lerp.png)
 
@@ -10,5 +13,11 @@ This C# Beginner tutorial covers linear interpolation which is often shortened t
 
 
 ## Code
-The example consists of a simple timer that resets after a couple seconds. When the timer starts, a start position and a randomly generated target position are stored. A box will move between these two positions. Every frame a 'Lerp value' is calculated. The lerp value is used to determined what the current position of a moving box should be. Once the timer is done, the current position will become the start position and a new target position is again randomly generated.
-[!code-csharp[Lerp](..\..\..\..\stride\samples\Tutorials\CSharpBeginner\CSharpBeginner\CSharpBeginner.Game\Code\LerpDemo.cs)]
+
+### Project
+The example consists of a s
+[!code-csharp[project](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\01_UI-Basics\UIByCode)]
+
+## Unproject
+The example consists of a s
+[!code-csharp[unproject](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\01_UI-Basics\UIByCode)]

+ 9 - 10
en/tutorials/csharpintermediate/raycasting.md

@@ -1,20 +1,19 @@
 # Raycasting
-You can find this sample in the tutorial project: **Menu** → **Adding a component** 
 
 ## Explanation
-This C# Beginner tutorial covers how to add and remove components. In the previous tutorial we learned how we can retrieve components that are already attached to an entity through the editor. This tutorial shows that we can accomplish the same thing by code. We can add the same component several times to the same entity. We also learn how to remove all of components of the same type again.
+This C# Intermediate tutorial covers raycasting. Raycasting is an essential subject in 3d games. With raycasts we can detect if and what kinds of objects are in our line of sight. This can used for detecting enemies or how far an object really is. 
 
-![Add a component](media/adding-a-component.png)
+![Add a component](media/raycasting.png)
 
 
 <iframe width="560" height="315" src="https://www.youtube.com/embed/KGuBSRyRmVo" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
 
 ## Code
-### AmmoComponent
-This is the AmmoComponent. We will not attach it to the entity in the editor. Instead we will add it ourselves in the AddingAComponent script.
-[!code-csharp[AmmoComponent](..\..\..\..\stride\samples\Tutorials\CSharpBeginner\CSharpBeginner\CSharpBeginner.Game\Code\AmmoComponent.cs)]
+### Raycast
+This script send out a raycast from the weapons barrel and sends it to an endpoint a little further. We check if hit something along the way. If we do, we calculate the distance between the weapon barrel and the hit point. We than scale a laser to that distance to visualize the actual raycast. Depending on the collision group and filters, some objects are ignored.
+[!code-csharp[editorpages](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\03_Raycasting\raycastdemo.cs)]
 
-### Adding A Component
-This component script, will add the AmmoComponent script to the entity. We then add another component (of the same type) before we remove all components of that type.
-Finally we learn how to automatically create a component, attach it to the entity and get a reference all in 1 line of code. This only works if the entity doesn't have any components of the given attached yet.
-[!code-csharp[AddingAComponent](..\..\..\..\stride\samples\Tutorials\CSharpBeginner\CSharpBeginner\CSharpBeginner.Game\Code\AddingAComponentDemo.cs)]
+
+### Penetrative raycast
+In our first script, the raycast returns to us as soon as it hits the first object along it path. We can also send out a raycast to an endpoint, and let it return to us when it has reach its endpoint. It gives us back a list of objects that it has hit along the way. This list can be empty but also exist out of various objects. Depending on the collision group and filters, some objects are ignored.
+[!code-csharp[editorpages](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\03_Raycasting\pentrativeraycastdemo.cs)]

+ 9 - 5
en/tutorials/csharpintermediate/scenes.md

@@ -1,14 +1,18 @@
-# Transform Position
-You can find this sample in the tutorial project: **Menu** &rarr; **Transform Position** 
+# Scenes
 
 ## Explanation
-This C# Beginner tutorial covers the Transform component of an entity. The Transform component is such a commonly used component, that you can quick access it via 'Entity.Transform'. The transform contains all kinds of properties and methods for Position, Rotation and Scale. In this example we learn the difference between local and world position.
+This C# Intermediate tutorial covers loading/unloading scenes and child scenes. Levels in Stride are build using 'Scenes'. A scene is hierarchy of the objects or entities in your world. A single scene can contain an infinite amount of child scenes which can be loaded and unloaded at any point. Those child scenes can be loaded with an offset if desired.
 
-![Transform Position](media/transform-position.png)
+![Transform Position](media/scenes.png)
 
 
 <iframe width="560" height="315" src="https://www.youtube.com/embed/2N6NhijZuJk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
 
 
 ## Code
-[!code-csharp[Entity](..\..\..\..\stride\samples\Tutorials\CSharpBeginner\CSharpBeginner\CSharpBeginner.Game\Code\TransformPositionDemo.cs)]
+### Loading a child scene
+[!code-csharp[editorpages](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\06_Scenes\LoadChildScene.cs)]
+
+### (Re)loading a scene
+
+[!code-csharp[editorpages](..\..\..\..\stride\samples\Tutorials\CSharpIntermediate\CSharpIntermediate\CSharpIntermediate.Game\06_Scenes\LoadScene.cs)]