Global

Methods

animate()

The rendering loop.
Source:

computePatchWidth() → {number}

binary search for getting patch edge size. Implemented after http://stackoverflow.com/questions/6463297/algorithm-to-fill-rectangle-with-small-squares.
Source:
Returns:
the patch width.
Type
number

init()

Initializes the WebGL components and loads the first molecule.
Source:

initGui()

Initializes the GUI and adds callbacks for change events.
Source:

initPreprocessing()

Sets up rendering components for Ambient Occlusion.
Source:

loadMolecule(url)

loads a molecule and calls functions to calculate the ambient occlusion map.
Parameters:
Name Type Description
url string the URL from which to request the PDB file to load.
Source:

loadShader(shader, type)

Loads a shader.
Parameters:
Name Type Description
shader DOMElement the element describing the shader.
type "fragment" | "vertex" the type of shader.
Source:

onWindowResize(event)

Event listener to resize the renderer, render target and camera accordingly.
Parameters:
Name Type Description
event UIEvent the triggered event
Source:

orthoView(direction, show) → {THREE.OrthographicCamera}

Creates a THREE.OrthographicCamera facing the molecule from the given direction. The molecule has to completely be in the camera's frustum.
Parameters:
Name Type Description
direction THREE.Vector3 the direction in which the camera should face.
show boolean creates and adds a THREE.CameraHelper to the scene.
Source:
Returns:
The camera looking at the molecule from the given direction.
Type
THREE.OrthographicCamera

preprocess()

Creates the light map for Ambient Occlusion.
Source:

render()

The rendering function.
Source:

shadersLoadComplete()

Starts initialization of the actual application after the shaders have been loaded.
Source:

start()

Entry point. First loads all the shaders, then init() etc. is called after load completion.
Source:

updateLightMapOutput()

Updates the output of the light map (used for debugging).
Source:

updateLightMapTarget()

Updates the render targets containing the light map for Ambient Occlusion.
Source:

updatePreprocessing()

Updates rendering components for Ambient Occlusion.
Source: