Voxelers / 3d

3D in Voxelers
Apache License 2.0
9 stars 1 forks source link

Explore the Godot 3D Game tutorial #32

Open acs opened 2 years ago

acs commented 2 years ago

Let's explore the tutorial:

https://docs.godotengine.org/en/latest/getting_started/first_3d_game/

to understand it, try to use it with Godot4 and understand the key concepts: modelling, layout, animation and rendering. And also, the next steps to do based on it.

acs commented 2 years ago

The tutorial can be easily executed inside Godot. Just open godot from its binary and import the folder cloned from the tutorial repository.

Screenshot from 2022-03-31 14-26-27 Screenshot from 2022-03-31 14-26-53

acs commented 2 years ago

Models

There are just 2 3D models created using Blender:

blender godot-3d-dodge-the-creeps/3d_models/
mob.blend     player.blend

Screenshot from 2022-03-31 14-32-53 Screenshot from 2022-03-31 14-33-22

But in order to use them in Godot, they have been exported in Blender to glb format:

godot-3d-dodge-the-creeps/dodge_the_creeps_3d/art/mob.glb
godot-3d-dodge-the-creeps/dodge_the_creeps_3d/art/player.glb

From the tutorial:

The .glb files contain 3D scene data based on the open-source GLTF 2.0 specification. They're a modern and powerful alternative to a proprietary format like FBX, which Godot also supports. To produce these files, we designed the model in Blender 3D and exported it to GLTF.

In Godot4, blender3 models can be used directly: https://twitter.com/reduzio/status/1509245247326457859

acs commented 2 years ago

Ok, I have read the tutorial and I am comfortable with it. Next step is to implement from scratch the game to learn all the details.

acs commented 2 years ago

The tutorial is easy to follow. I have just finished the player 3d creation, and configuring the keys to move the player in 3d.

Moving a KinematicBody in 3D is defining the directional speed the object must have. To define the 3D directional speed, we detect the keys pressed in each frame (_physics_process is called before rendering each frame with the frame rate defined by delta), define the direction and normalize it (if you press forward+right it should go in diagonal), point the object looking at and call the method which does the magic move_and_slide. This method has in its logic possible collisions with other objects and use the physics engine for natural hits reaction.

acs commented 2 years ago

And it is wonderful to play with the camera view to have a two views visualization. In one of them you have the camera position and in the other, the camera view. In this way, it is pretty easy to adjust the camera position to what you need.

Screenshot from 2022-04-07 07-26-57

acs commented 2 years ago

The basic movement of the 3D object in the world is now implemented. It is pretty easy to implement it.

output

acs commented 2 years ago

Thinking about the movement of 3D figures, the basic movement as we did in the above comment is pretty easy. And it gets realistic thanks to rotating and setting the direction, but I am sure it will be much complex if you want to move different parts of the same 3D object at the same time in a sync way.

Animating people for example must be a big challenge. But let's continue step by step. For example, with the addition of a wave movement done it the same tutorial.

acs commented 2 years ago

Just pending to review all sections but this task is mostly done!