Tag Archive: Soya3D


Soya3D: First Look

I am back with more news from Soya3D. Having developed a ‘Hello World’ kinda application, I am both happy as well as a bit disappointed with the library. Before going into my impressions about the library have a look at the ‘Hello World’ kinda app’s code:

import sys,os, os.path, soya

#initialize soya
soya.init(title = “First”, width = 640, height =480)

#set the data path
soya.path.append(os.path.join(os.path.dirname(sys.argv[0]), “data”))

#create the root of the scene graph

scene = soya.World()

#load model
sun_model = soya.Model.get(“sun”)

#class that rotates the model. The class has been inherited from soya.Body. And it overrides advance_time for adding #rotation

class rotating_sun(soya.Body):
def advance_time(self, proportion):
soya.Body.advance_time(self, proportion)
self.rotate_y(proportion*15.0)
self.rotate_x(10)
#create and attach the model to the scene graph a.k.a world
sun = rotating_sun(scene, sun_model)

#create a light source
light = soya.Light(scene)
light.set_xyz(0.5, 0.0, 2.0)

#set the camera
camera = soya.Camera(scene)
camera.z = 2.0

soya.set_root_widget(camera)

soya.MainLoop(scene).main_loop()

The app loads a model and then rotates it. If you have programmed using TKinter library, you can notice the similarity. Now the good bits about Soya3D:

  • Ease of use in terms of library
  • Simple API model
  • Good amount of example codes
  • Step-by-step explanation
  • Rendering time is good

Now what disappoints me are:

  • The loading time for this simple app ~ 10  secs on my centrino core duo laptop. Thats a bit high. The load time can be discounted due to the interpreted nature of Python
  • Whenever I move the window of the app, the app freezes. Why does this happen – no idea. Couldnt get anything from the docs as well.

Apart from these two I did not encounter any dissapointments. If anyone has any work arounds for this do post. Till next time

Setting up Soya3D

What you need

1. Python 2.4.x :

This is the major requirement. Soya3D and its dependencies require Python 2.4.x otherwise they wont install. I was a bit put off by this

2.  pyOgg 1.3 for Python 2.4

This is for enabling music.  It is Ogg part of Ogg-Vorbis.

3.  pyVorbis 1.4 for Python 2.4

Also for music enabling. Vorbis part of Ogg-Vorbis.

4. Cerealizer 0.4 for Python 2.4

For saving objects in files. Better than pickle as this one is safer. Dont use exe file with is download. Use the following

http://download.gna.org/soya/Cerealizer-0.5.tar.bz2

Untar it using 7-zip.  Fire up the command prompt. Move into the folder created. Run setup.py with build as option. Then run setup.py with install as option. Thats it.

5.  Tofu 0.4 for Python 2.4

Testing framework. Need to read more about this one.

6.  Py2Play0.1.7 for Python 2.4

Peer-to-peer gaming framewor for Python. Soya3dD uses this for networking aspect of gaming.

7.  pysdl_mixer-0.0.3 for Python 2.4

Sound mixer is provided by PySDL Mixer – a port of SDL Mixer.

8.  SDL_Mixer dlls

Thats a lot of softwares to download. But thanks to the following site, I got everything under one roof (so as to say)

http://thomas.paviot.free.fr/soya/

Thats it for now. Next I am going to try out some of the examples.

Follow

Get every new post delivered to your Inbox.