If you have looked at the source code of my previous demos, this demo is very similar to most of them. However there is one line of code, I want you to pay attention to; and it's line number 20 in main.c
#include "../models/mokey.h"
As you can see, it is just a header file the program is calling. This header file has been automatically generated by the blender script. The creation of this file will be the focus of this demo.
Open blender and you will see a screen similar to this
Press the X-KEY on your keyboard and click "Erase selected"
Press the SPACE-KEY on your keyboard and select add -> mesh -> monkey
Click "Ooooh Oooh Ooooh" to confirm your selection
Your are going to see a tiny pink object in the center of the screen. It is hard to make out the shape of it. You can zoom in by pressing the the "+" KEY on your numeric pad. Press the plus sign 12 times to enlarge the object.
As a side note, the object name is "Suzanne". You can see it at the bottom left corner of the 3D view window.
To render the object within blender press the "F12" KEY on your keyboard. You will see a window similar to this. Let's close the window and proceed.
Save the file you just created, from the main menu select File -> Save.
You can call it monkey.blend and click the "Save As" button
Finally we are ready to export the object into a PS2 Linux compatible format. From the main menu select File -> Export -> PS2 C Arrays (.h)...
Type the file name without the extension. The program will append the extension .h to your file.
Click twice the button that says "Export h".
Confirm the message on your shell or dos window. It should look like this.
Your model has now been generated as a header file, ready to be use in your program.
Here is a demo that incorporates all the steps you have just completed.
download gzip file (size 23 Kb)
This 3D object has been created in Blender and rendered in PS2 Linux
As usual, I welcome any questions or suggestions.
My email is carlos_v_neto "at" hotmail.com
Thanks,
Carlos Neto