Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| brasil:courses:blender_unity:unity:2_game_objects [2026/08/18 21:03] – [Creating Your First GameObject] yann | brasil:courses:blender_unity:unity:2_game_objects [2026/08/24 21:21] (Version actuelle) – [Scene Rendering] yann | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | <note tip> | ||
| + | **Get an offline copy of this page by clicking the libreoffice writer icon** ~~ODT~~ | ||
| + | </ | ||
| + | |||
| + | ------ | ||
| + | |||
| ====== GameObjects : Earth V 1.0 ====== | ====== GameObjects : Earth V 1.0 ====== | ||
| Ligne 22: | Ligne 28: | ||
| Assets are all the source files for your game (3D models, textures, sounds, images, etc.). | Assets are all the source files for your game (3D models, textures, sounds, images, etc.). | ||
| - | {{: | + | {{ : |
| - | From Windows File Explorer, copy and paste your ground | + | From Windows File Explorer, copy and paste your earth texture into the “Textures” subfolder. |
| - | {{: | + | {{: |
| Now, go to the menu at the very top: GameObject / 3D Object / Sphere. | Now, go to the menu at the very top: GameObject / 3D Object / Sphere. | ||
| - | {{: | + | {{ : |
| We create a sphere primitive directly in Unity. | We create a sphere primitive directly in Unity. | ||
| Ligne 37: | Ligne 43: | ||
| Our GameObject is named “Sphere” and consists of 3 components. | Our GameObject is named “Sphere” and consists of 3 components. | ||
| - | {{: | + | {{ : |
| The Different Components of the “Sphere” GameObject | The Different Components of the “Sphere” GameObject | ||
| Ligne 55: | Ligne 61: | ||
| We’ll start by renaming our GameObject. | We’ll start by renaming our GameObject. | ||
| It’s important to name things properly; otherwise, when your scene contains dozens of GameObjects, | It’s important to name things properly; otherwise, when your scene contains dozens of GameObjects, | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Collisions aren't important in this example, so we're going to remove (delete) the “Sphere Collider” component. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | We’re now going to create a material so we can assign the texture to the sphere. | ||
| + | Create a new folder at the root of the Assets folder and name it “Materials.” Double-click the folder you created to open it. | ||
| + | |||
| + | Now create a new material (Create / Material) | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | You will name this material “EarthMat.” | ||
| + | Select this material; its properties will appear in the right-hand panel. | ||
| + | Click the small dot (anchor) next to " | ||
| + | Select the earth texture (JPEG bitmap texture). | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | We're now going to assign the “EarthMat” material to our “Earth” sphere. | ||
| + | Select the “Earth” GameObject in the left panel. | ||
| + | Click the small anchor point next to Materials / Element 0. | ||
| + | Select the “EarthMat” material. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ===== Scene Rendering ===== | ||
| + | |||
| + | There you go—our planet Earth is textured! | ||
| + | Double-click “Earth” in the left panel (the one that lists all the GameObjects in the scene) to re-center the editor view on the sphere. | ||
| + | |||
| + | Now select the “Main Camera” in the left panel. | ||
| + | In the bottom-right corner of the 3D view, you’ll see a preview of what the camera will see at runtime (when the game is running). | ||
| + | |||
| + | The Earth is a little too small—here are two solutions… | ||
| + | – You can enlarge the sphere by changing its scale in the Transform component of the sphere’s GameObject. | ||
| + | – Or, you can set the camera to a wider field of view. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | Set “Field of view” to 10, select “Solid Color” for Clear Flags, and set the Background to black. To get pure black, all three R, G, and B components must be 0. Set the camera' | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | There you go—our scene is ready to be rendered! | ||
| + | Click the small “Play” button at the top center of the Unity editor. | ||
| + | This will switch you to “Game” view, which lets you see exactly what your planet will look like when your game is actually running (at runtime). | ||
| + | |||
| + | The Play button lets you preview the game's runtime. | ||
| + | |||
| + | {{ : | ||
