Skip to content

Instantly share code, notes, and snippets.

@juanpabloaj
Created July 31, 2011 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juanpabloaj/1117143 to your computer and use it in GitHub Desktop.
Save juanpabloaj/1117143 to your computer and use it in GitHub Desktop.
vpython boxs rotation
#!/usr/bin/python
# -*- coding: utf-8 -*-
import visual
visual.scene.width = 500
visual.scene.heigth = 500
visual.scene.center = (0,0,0)
visual.scene.title = "Rotate"
cube = visual.box(pos=(0,0,0),axis=(0,0,1),length=0.1,width=0.1,height=0.1,color=visual.color.blue)
visual.box(pos=(1,0,0),axis=(0,0,1),length=0.3,width=0.3,height=0.3,color=visual.color.blue)
while True:
visual.rate(1)
visual.scene.forward = visual.scene.forward.rotate(angle=0.095,axis=visual.scene.up)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment