LinkTree Posted September 6, 2015 Share Posted September 6, 2015 I ported the Three.js plugin from the panda 1.3 plugins repository to work with panda 2.0.you can find it here: https://github.com/LinkTree3/Panda.js-plugins Usage example taken from the 1.3 plugins repository:game.module( 'game.main').require( 'plugins.three').body(function() {game.createClass('Box', { init: function(width, height, depth) { this.geometry = new game.THREE.BoxGeometry(width, height, depth); this.material = new game.THREE.MeshBasicMaterial({ color: Math.round(Math.random() * 16777215), }); this.mesh = new game.THREE.Mesh(this.geometry, this.material); game.scene.scene.add(this.mesh); }, update: function() { this.mesh.rotation.x += 1 * game.system.delta; this.mesh.rotation.y += 2 * game.system.delta; }});game.createScene('Main', { init: function() { this.scene = new game.THREE.Scene(); this.camera = new game.THREE.PerspectiveCamera(75, game.system.width / game.system.height, 1, 10000); this.camera.position.z = game.system.height; this.camera.position.x = game.system.width / 2; this.camera.position.y = game.system.height / 2; for (var i = 0; i < 10; i++) { var box = new game.Box(200, 200, 200); box.mesh.position.x = Math.random() * game.system.width; box.mesh.position.y = Math.random() * game.system.height; box.mesh.position.z = -Math.random() * 1000; this.addObject(box); } }});}); zakhov 1 Quote Link to comment Share on other sites More sharing options...
zakhov Posted September 8, 2015 Share Posted September 8, 2015 This is really nice. Would be really useful for a demo that I'm planning to do soon, now I can just use PandaJS and this plugin. Thanks! Quote Link to comment Share on other sites More sharing options...
LinkTree Posted September 9, 2015 Author Share Posted September 9, 2015 This is really nice. Would be really useful for a demo that I'm planning to do soon, now I can just use PandaJS and this plugin. Thanks!You're welcome, I am glad you could find use for this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.