Sunday, January 13, 2013

Raytracing on the web

I had this in mind for quite a while but never got the chance to implement it. But there it is: A ray-traced molecule visualizer available on the web. The following syntax enables access to a remote HTTP service using the GPU to generate the JPEG image.


http://localhost/get?molecule=XXXX[&scheme=0|1|2][&structure=0|1|2|3][&rotation=<float>,<float>,<float>][&quality=<integer>]

Parameters:
  • molecule=XXXX
    • 4 capital letters identifiying the molecule. The list bellow is  the only one you can use for now).
  • scheme=[0|1|2]
    • 0: Standard
    • 1: Chain
    • 2: Residue
    • example: scheme=2
  • structure=[0|1|2|3]
    • 0: Real size atoms
    • 1: Fixed size atoms
    • 2: Sticks
    • 3: Sticks and atoms 
    • 4: Backbone
    • example: structure=1
  • rotation=[x,y,z] Rotates the molecule according to x,y and z. Note that x,y,and z are real numbers specifying degrees of rotation for each axe.
    • example: rotation=45,0,0
  • quality=[1-100]
    • Identifies the number of iterations to process. The higher the better, and slower... 
  • bkcolor=[r,g,b] Specifies the red, green and blue values for background color.
    • example: bkcolor=255,0,127
  • postprocessing=[0|1|2]
    • 0: None
    • 1: Depth of field
    • 2: Ambient occlusion
  • size=[0|1|2|3|4]
    • 0: 512x512
    • 1: 768x768
    • 2: 1024x1024
    • 3: 1600x1600
    • 4: 2048x2048