Python is an object oriented scripting language. We have interfaced raytressi and Python, so you could write your scripts in Python, in a friendly script editor. Moreover, you won't have to compile your scripts using VisualC++ if you use Python.
More information about Python : www.python.org
Python language isn't difficult to use because it looks like Java or C++ i.e commonly used languages. Have a look at the examples !
One noticeable thing to say about Python, before you start typing around, is that indentation DOES MATTER !
An example :
#this is a comment #this comment is not indented print 'neither is this command' #this comment IS INDENTED print "and so is this command, so you'll probably get an error from Python !!!"
If you are curious, here is how you use indentation in Python (you don't need to know this until you try to do complicated things with raytressi !) :
print 'hello, world'
def myFunction():
print 'you are in myFunction'
print 'here too...'
print 'but now declaration of function myFunction is ended !'
myFunction()
# the previous line is a call to the function
# notice that you can't put comments at the end of a line
To make a script in Python for Raytressi, you don't have to declare a Raytracer object or a Scene object (although you may...). Indeed, two objects are already declared as your script starts executing :
raytracer.setRayMaxDepth(newDepth)
You can also enable adaptive antialiasing with :
raytracer.enableAntialiasing(numberOfSamples, threshold)
NumberOfSamples (default : 3) is the number of samples taken for an antialiased pixel (instead of one in the default implementation), while threshold (default : 0.1) is the difference between two adjacent pixels above which antialiasing super sampling will occur.
myLoader = SceneLoaderAse() myTempScene = Scene() myLoader.load(myTempScene, 'sphere.ase') myTempScene.setObjectMatrix(0, createMatrix(translation=(-1,0,7))) scene.addScene(myTempScene)
Method setObjectMatrix modifies the matrix of object number [first argument] to the new matrix [second argument].
The same applies to method setObjectMaterial...