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
