Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
brasil:courses:blender_unity:unity:2_game_objects [2026/08/18 21:03] – [Creating Your First GameObject] yannbrasil: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~~
 +</note>
 +
 +------
 +
 ====== 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.).
  
-{{:brasil:courses:blender_unity:unity:unitycreatefolder-1024x576.jpg|}}+{{ :brasil:courses:blender_unity:unity:unitycreatefolder.png?1024 |}}
  
-From Windows File Explorer, copy and paste your ground texture into the “Textures” subfolder.+From Windows File Explorer, copy and paste your earth texture into the “Textures” subfolder.
  
-{{:brasil:courses:blender_unity:unity:unitytexturessubfolder.png|}}+{{:brasil:courses:blender_unity:unity:unitycreatefolder2.png}}{{:brasil:courses:blender_unity:unity:unitycreatefolder3.png}}
  
 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.
  
-{{:brasil:courses:blender_unity:unity:unitycreatesphere.jpg|}}+{{ :brasil:courses:blender_unity:unity:unitycreatesphere.png |}}
  
 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.
  
-{{:brasil:courses:blender_unity:unity:unitycomponents.jpg|}}+{{ :brasil:courses:blender_unity:unity:unityspherepropertiesannoted.png?1024 |}}
  
 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 will become unmanageable. Rename “Sphere” to “Earth.” It’s important to name things properly; otherwise, when your scene contains dozens of GameObjects, it will become unmanageable. Rename “Sphere” to “Earth.”
 +
 +{{ :brasil:courses:blender_unity:unity:unitysphererename.png |}}
 +
 +Collisions aren't important in this example, so we're going to remove (delete) the “Sphere Collider” component.
 +
 +{{ :brasil:courses:blender_unity:unity:unitysphereremovecomponent.png |}}
 +
 +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)
 +
 +{{ :brasil:courses:blender_unity:unity:unityspherecreatematerial.png |}}
 +
 +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 "BaseMap".
 +Select the earth texture (JPEG bitmap texture).
 +
 +{{ :brasil:courses:blender_unity:unity:unityspherematearth.png |}}
 +
 +{{ :brasil:courses:blender_unity:unity:unityspherematearth2.png |}}
 +
 +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.
 +
 +{{ :brasil:courses:blender_unity:unity:unitysphereassignmat.png?1024 |}}
 +
 +{{ :brasil:courses:blender_unity:unity:unitysphereassignmat2.png |}}
 +
 +===== 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.
 +
 +{{ :brasil:courses:blender_unity:unity:unitycamerascene.png?1024 |}}
 +
 +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's Y position to 0.08 to better frame the planet.
 +
 +{{ :brasil:courses:blender_unity:unity:unitycamerascene2.png?1024 |}}
 +
 +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.
 +
 +{{ :brasil:courses:blender_unity:unity:unitycamerascenegame.png?1024 |}}
brasil/courses/blender_unity/unity/2_game_objects.1787079802.txt.gz · Dernière modification : de yann
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0