Created
July 10, 2013 03:11
-
-
Save nklsrh/5963199 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set up the paddle vars | |
paddleWidth = 10; | |
paddleHeight = 30; | |
paddleDepth = 10; | |
paddleQuality = 1; | |
// set up paddle 1 | |
paddle1 = new THREE.Mesh( | |
new THREE.CubeGeometry( | |
paddleWidth, | |
paddleHeight, | |
paddleDepth, | |
paddleQuality, | |
paddleQuality, | |
paddleQuality), | |
paddle1Material); | |
// add the paddle to the scene | |
scene.add(paddle1); | |
// Set up the second paddle | |
paddle2 = new THREE.Mesh( | |
new THREE.CubeGeometry( | |
paddleWidth, | |
paddleHeight, | |
paddleDepth, | |
paddleQuality, | |
paddleQuality, | |
paddleQuality), | |
paddle2Material); | |
// Add the second paddle to the scene | |
scene.add(paddle2); | |
// set paddles on each side of the table | |
paddle1.position.x = -fieldWidth/2 + paddleWidth; | |
paddle2.position.x = fieldWidth/2 - paddleWidth; | |
// lift paddles over playing surface | |
paddle1.position.z = paddleDepth; | |
paddle2.position.z = paddleDepth; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment