Panda3D Manual: Projected bamboo.jpg
Image File history Links Projected_bamboo.jpg‎ (36KB, MIME type: `image/jpeg`) This image was generated with the following program:
    from direct.directbase.DirectStart import *
    from direct.actor import Actor
    from pandac.PandaModules import *

    base.setBackgroundColor(1, 1, 1, 1)

    ripple = Actor.Actor('ripple.egg')
    ripple.reparentTo(render)
    ripple.setScale(10)
    ripple.pose('animation', 17)

    dl = DirectionalLight('dl')
    dlnp = camera.attachNewNode(dl)
    ripple.setLight(dlnp)

    proj = render.attachNewNode(LensNode('proj'))
    lens = PerspectiveLens()
    proj.node().setLens(lens)
    proj.node().showFrustum()
    proj.find('frustum').setColor(1, 0, 0, 1)
    camModel = loader.loadModel('camera.egg')
    camModel.reparentTo(proj)
    proj.reparentTo(render)
    proj.setPos(1.5, -7.3, 2.9)
    proj.setHpr(22, -15, 0)

    tex = loader.loadTexture('maps/envir-reeds.png')
    tex.setWrapU(Texture.WMBorderColor)
    tex.setWrapV(Texture.WMBorderColor)
    tex.setBorderColor(VBase4(1, 1, 1, 0))
    ts = TextureStage('ts')
    ts.setSort(1)
    ts.setMode(TextureStage.MDecal)
    ripple.projectTexture(ts, tex, proj)

    base.disableMouse()
    camera.setPos(-7.8, -22.4, 0)
    camera.setHpr(-21, 0, 0)

    base.graphicsEngine.renderFrame()
    base.screenshot('projected_bamboo.jpg', defaultFilename = 0)
## File history Legend: (cur) = this is the current file, (del) = delete this old version, (rev) = revert to this old version. Click on date to see the file uploaded on that date. (del) (cur) 02:05, 11 October 2005 . . Drwr (Talk | contribs) . . 400×300 (36,421 bytes) (del) (rev) 00:31, 11 October 2005 . . Drwr (Talk | contribs) . . 0×0 (38,832 bytes) Edit this file using an external application See the setup instructions for more information. ## Links The following pages link to this file: Projected Textures
Back to the Manual