DjangoBB

Django based forum engine

  • You are not logged in.

Poll

quest1

  •  
    0 votes (0.0%) for: 1
  •  
    0 votes (0.0%) for: 2
  •  
    0 votes (0.0%) for: 3
  •  
    0 votes (0.0%) for: 4
  •  
    0 votes (0.0%) for: 5
  •  
    0 votes (0.0%) for: 6
  •  
    1 vote (100.0%) for: 52

#1 July 21, 2013 06:51:23

thien02911
Registered: 2013-07-21
Posts: 1
Reputation: +  0  -
Profile   Send e-mail  

Testing

Test WYSIWYG


# Lesson1.py
import sys
 
import direct.directbase.DirectStart
from direct.interval.LerpInterval import LerpFunc
from panda3d.core import Texture, TextureStage
 
base.setBackgroundColor(0.0, 0.0, 0.0)
base.disableMouse()
 
base.camLens.setNearFar(1.0, 50.0)
base.camLens.setFov(45.0)
 
camera.setPos(0.0, -20.0, 10.0)
camera.lookAt(0.0, 0.0, 0.0)
 
root = render.attachNewNode("Root")
root.setPos(0.0, 0.0, 0.0)
 
textureArrow = loader.loadTexture("arrow.png")
textureArrow.setWrapU(Texture.WMClamp)
textureArrow.setWrapV(Texture.WMClamp)
 
stageArrow = TextureStage("Arrow")
stageArrow.setSort(1)
 
textureCircle = loader.loadTexture("circle.png")
textureCircle.setWrapU(Texture.WMClamp)
textureCircle.setWrapV(Texture.WMClamp)
 
stageCircle = TextureStage("Circle")
stageCircle.setSort(2)
 
modelCube = loader.loadModel("cube.egg")
 
cubes = []
for x in [-3.0, 0.0, 3.0]:
    cube = modelCube.copyTo(root)
    cube.setPos(x, 0.0, 0.0)
    cubes += [ cube ]
 
base.accept("escape", sys.exit)
 
base.accept("o", base.oobe)
 
def animate(t):
    for i in range(len(cubes)):
        cubes[i].setH(t * (2.0 ** i))
 
interval = LerpFunc(animate, 5.0, 0.0, 360.0)
 
base.accept("i", interval.start)
 
def move(x, y, z):
    root.setX(root.getX() + x)
    root.setY(root.getY() + y)
    root.setZ(root.getZ() + z)
 
base.accept("d", move, [1.0, 0.0, 0.0])
base.accept("a", move, [-1.0, 0.0, 0.0])
base.accept("w", move, [0.0, 1.0, 0.0])
base.accept("s", move, [0.0, -1.0, 0.0])
base.accept("e", move, [0.0, 0.0, 1.0])
base.accept("q", move, [0.0, 0.0, -1.0])
 
run()

Youtube code please

Offline

Board footer

Moderator control

Powered by DjangoBB

Lo-Fi Version