Godot 3.1: Creating a Simple 3D Game: Part 3 (Importing from Blender, Rolling & Keys) #GodotEngine
Video Statistics and Information
Channel: BornCG
Views: 85,444
Rating: undefined out of 5
Keywords: tutorial, lesson, 3D, beginner, game engine, game, engine, godot, blender, blender 2.8, gltf, roll, rotation, programming, code, coding, gdscript
Id: VWy4ErYd630
Channel Id: undefined
Length: 31min 10sec (1870 seconds)
Published: Tue May 28 2019
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
Fantastic video - can't wait for the rest of them to come out.... you can't get done with this series soon enough.
Love how you cracked the method for getting objects from Blender to Godot with the cycles materials - this is what basically stopped me from playing with Godot late in 2018; the process used to be way too cumbersome.
I made a version with a skull and another with Suzanne rolling around instead of the ball.
I am subscribed and clicked the bell. Keep up the good work!
Although 3D is not really my focus, I have to say I'm enjoying this series. It's very well done and I'm looking forward to the next :)
Also, for the rotations, I believe you can get accurate rotation results by rotating the ball locally around the axis perpendicular to its motion vector, V, in the x-z plane (i.e., rotate around (-V.z, V.x)
.normalized()
). It seems therotate(axis, angle)
method fits the bill. I'm not all too familiar with the 3D side of Godot, but I think this would work nicely.As for calculating the angle parameter's value, first divide its linear speed - the magnitude of the motion vector in x-z - by 2 * PI * sphere's radius, which will give you how many revolutions/sec the ball is experiencing, in that direction. Then you can convert that to radians by multiplying by 2 * PI. Finally, you multiply by delta to get the per-frame rotation. This simplifies to: rotation per frame (in radians) = speed / radius * delta. I'm not completely certain of the angle sign, since the motion of the ball in the video is based on restricted directions, and the speed is simply inverted based on the axis direction for each of the x- and z-axes. That being said, it seems that negative angles correspond to clockwise rotation around the axis perpendicular to the direction of travel, which is what you would observe if you were to roll a ball and you were observing it from the side; it would appear to be rotating clockwise as it rolled forward (like when the ball rolls to the right in the video).
These are amazing videos, please keep the series going!