예제 #1
0
파일: effects02.py 프로젝트: Knio/miru
from miru import core
from miru import graphics
from miru.context import context

fog = effects.Fog(density=0.075, color=(0.65,0.9,0.75,0.5), equation=effects.Fog.EQ_EXP)
w = TestWindow(680, 400, clear_color=fog.color)

w.set_vsync(False)

context.camera.pos=(0,1.25,4)
context.window = w
context.control = input.SimpleMouseControl()

utils.add_fps_display(context)

o = w._load_object()
o.pos += (2,0.55,-3)
o = w._load_object()
o.pos += (0.5,1.55,-10)
o = w._load_object()
o.pos += (-0.5,0.55,0)


pattern = pyglet.image.CheckerImagePattern(
        (90,0,0,200), (0,30,0,200))
tex = pattern.create_image(64, 64).get_texture()
coords = []
for i in range(0, len(tex.tex_coords), 3):
    coords.extend(tex.tex_coords[i:i+3] + (0.125 / 2,))
batch = pyglet.graphics.Batch()
group = graphics.TextureBindGroup(tex.id)
예제 #2
0
파일: track03.py 프로젝트: Knio/miru
from miru.context import context
from miru.track import SSCameraTrack, PosTrack
from miru import utils

import os

# initialize the window
w = TestWindow(680, 400)
w.set_vsync(False)

context.camera.pos = (0,5,10)
context.window = w

utils.addFpsDisplay()

target = w._load_object()
#target = loadObj(os.path.join('docs', 'demo', 'yam.obj'))
#target.angle = (0,45,0)
#context.addobj(target)

target.pos += (0,5,5)
target.angle.x = 45

# Here we set up two tracks.  The first is a side scroller
# track the will move the camera only as the object reaches
# the edge of the screen.  The second is a normal positional
# track - but only on the z coordinate of the object.
track = SSCameraTrack(context.camera, target, context.window)
track2 = PosTrack(context.camera, target, axes=(0,0,1))

#context.addobj(CoordPlane(magnitude=50, step=1, color=(1,1,0,1)))