Graphics Programs Reference
In-Depth Information
Objective Complete - Mini Debriefing
This task of the project was enirely dedicated to seing up the objects of our scene for the
Blender Game Engine. We started by creaing the setup of objects that will serve us as the
primary mechanism to perform the navigaion of the scene. One thing to highlight here is
that by using these objects and the parening relaionship between them we are saving a lot
of coding, since that behavior is already automaically handled by the BGE itself. An example
of the kind of complexity that this helps us to avoid is that the rotaions are very simple
degree or radian values, while in reality the calculaions that Blender performs internally to
handle rotaions involve matrices! Sorry for using exoic mathemaical terms here, but there
is no other way to explain it, really.
Then we created a setup of logic bricks, which helps us even more in hiding the real
complexity involved in doing this kind of interacive project. The nice thing about logic bricks
is that the BGE has already deined a whole internal mechanism for detecion for events and
passing of messages between sensors, controllers, and actuators, so that we can just start
using all that by clicking around in the interface.
Scripting
The final task of our project is to work on coding two scripts that will significantly enhance
the final behavior of the walkthrough. In this coding part, we will just transcribe the code
lisings provided; let's also pay special atenion to the explanatory texts embedded in the
code as comments (statements ater the # sign).
Engage Thrusters
1.
Let's go to the Logic Editor and change it to a Text Editor ( Shift + F11 ), then add
a new text datablock, name it move.py , and enter this code (the comments are
opional):
Since the lisings of code don't show some things (usage of tabs, spaces, and
indentaion) required explicitly for the Python interpreter to accept our code, it's
highly recommended to use these lisings only as a reference. The actual code
should be taken from the iles provided along with the topic.
# make the functionality of these libraries available in the scope
of this script. "bge" is used 99.9% of the time in scripts for the
BGE
import bge
import math
import mathutils
 
Search WWH ::




Custom Search