Example #1
0
def moveCamera(posCams, posEyes=None, dirCams=None, moveEye=False, N=100, speed=1., pos=-1):
    """Move camera.
    Usage: moveCamera(checkPoints, moveEye, N, speed, pos)."""
    if isinstance(posCams[0], str): # zone
        posCams = C.getAllFields(posCams, 'nodes')
    if posEyes is not None and isinstance(posEyes[0], str): # zone
        posEyes = C.getAllFields(posEyes, 'nodes')
    if dirCams is not None and isinstance(dirCams[0], str): # zone
        dirCams = C.getAllFields(dirCams, 'nodes')
    CPlot.moveCamera(posCams, posEyes, dirCams, moveEye, N, speed, pos)
# - moveCamera (array) -
import Geom as D
import Converter as C
import Transform as T
import CPlot

# Model
a = D.sphere((0,0,0), 1., N=20)
CPlot.display(a, posCam=(3,-1,0.7), posEye=(0,0,0))

t = 0.
for i in range(1000):
    # change model
    defo = C.initVars(a, '{df}=0.1*cos(%f)*sin(10*pi*{x})'%(t))
    defo = C.extractVars(defo, ['df'])
    b = T.deformNormals(a, defo)
    # Move camera
    CPlot.moveCamera([(3,-1,0.7),(3,5,0.7),(3,7,0.7)], N=1000, pos=i)
    CPlot.display(b)
    t += 0.05
# - moveCamera (array) -
import Geom as D
import CPlot

# Model
a = D.sphere((0, 0, 0), 1., N=20)
CPlot.display(a, posCam=(3, -1, 0.7), posEye=(0, 0, 0))

# Move camera
CPlot.moveCamera([(3, -1, 0.7), (3, 5, 0.7), (3, 7, 0.7)])