<commit_before>#!/usr/bin/python
'''Test for an openGL based stereo renderer - testing render stack features (compositing via over shader and blurring via convolution shader)

<NAME>
Feb 2017 - converted to test suite - failing depth test for render to framebuffers

www.qenops.com

'''
__author__ = ('<NAME>')
__version__ = '1.0'

import OpenGL
OpenGL.ERROR_CHECKING = False      # Uncomment for 2x speed up
OpenGL.ERROR_LOGGING = False       # Uncomment for speed up
#OpenGL.FULL_LOGGING = True         # Uncomment for verbose logging
#OpenGL.ERROR_ON_COPY = True        # Comment for release
import OpenGL.GL as GL
import math
import numpy as np
import dGraph as dg
import dGraph.ui as ui
import dGraph.cameras as dgc
import dGraph.shapes as dgs
import dGraph.materials as dgm
import dGraph.materials.warp
import dGraph.util.imageManip as im

MODELDIR = './dGraph/test/data'

def loadScene(renderStack,file=None):                
    '''Load or create our sceneGraph'''
    backScene = dg.SceneGraph(file)
    bCam = dgc.Camera('back', backScene)
    bCam.setResolution((renderStack.width, renderStack.height))
    bCam.setTranslate(0.,0.,0.)
    bCam.setFOV(50.)
    renderStack.cameras.append(bCam)
    cube = dgs.PolySurface('cube', backScene, file = '%s/cube.obj'%MODELDIR)
    cube.setScale(.4,.4,.4)
    cube.setTranslate(0.,0.,-2.)
    cube.setRotate(25.,65.,23.)
    renderStack.objects['cube'] = cube
    
    frontScene = dg.SceneGraph(file)
    fCam = dgc.Camera('front', frontScene)
    fCam.setResolution((renderStack.width, renderStack.height))
    fCam.translate.connect(bCam.translate)
    fCam.rotate.connect(bCam.rotate)
    fCam.setFOV(50.)
    teapot = dgs.PolySurface('teapot', frontScene, file = '%s/teapot.obj'%MODELDIR)
    teapot.setScale(.4,.4,.4)
    teapot.setTranslate(.5,-.2,-1.5)
    teapot.setRotate(5.,0.,0.)
    renderStack.objects['teapot'] = teapot<commit_msg>using better path for model dir<commit_after>#!/usr/bin/python
'''Test for an openGL based stereo renderer - testing render stack features (compositing via over shader and blurring via convolution shader)

<NAME>
Feb 2017 - converted to test suite - failing depth test for render to framebuffers

www.qenops.com

'''
__author__ = ('<NAME>')
__version__ = '1.0'

import OpenGL
OpenGL.ERROR_CHECKING = False      # Uncomment for 2x speed up
OpenGL.ERROR_LOGGING = False       # Uncomment for speed up
#OpenGL.FULL_LOGGING = True         # Uncomment for verbose logging
#OpenGL.ERROR_ON_COPY = True        # Comment for release
import OpenGL.GL as GL
import math, os
import numpy as np
import dGraph as dg
import dGraph.ui as ui
import dGraph.cameras as dgc
import dGraph.shapes as dgs
import dGraph.materials as dgm
import dGraph.materials.warp
import dGraph.util.imageManip as im

MODELDIR = '%s/data'%os.path.dirname(__file__)

def loadScene(renderStack,file=None):                
    '''Load or create our sceneGraph'''
    backScene = dg.SceneGraph(file)
    bCam = dgc.Camera('back', backScene)
    bCam.setResolution((renderStack.width, renderStack.height))
    bCam.setTranslate(0.,0.,0.)
    bCam.setFOV(50.)
    renderStack.cameras.append(bCam)
    cube = dgs.PolySurface('cube', backScene, file = '%s/cube.obj'%MODELDIR)
    cube.setScale(.4,.4,.4)
    cube.setTranslate(0.,0.,-2.)
    cube.setRotate(25.,65.,23.)
    renderStack.objects['cube'] = cube
    
    frontScene = dg.SceneGraph(file)
    fCam = dgc.Camera('front', frontScene)
    fCam.setResolution((renderStack.width, renderStack.height))
    fCam.translate.connect(bCam.translate)
    fCam.rotate.connect(bCam.rotate)
    fCam.setFOV(50.)
    teapot = dgs.PolySurface('teapot', frontScene, file = '%s/teapot.obj'%MODELDIR)
    teapot.setScale(.4,.4,.4)
    teapot.setTranslate(.5,-.2,-1.5)
    teapot.setRotate(5.,0.,0.)
    renderStack.objects['teapot'] = teapot
{'fraction_non_alphanumeric': 0.1241199478487614, 'fraction_numerical': 0.01877444589308996, 'mean_word_length': 3.678048780487805, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6835300', 'n_tokens_mistral': 1388, 'n_tokens_neox': 1333, 'n_words': 307}