diff --git a/rpz5shwv63.js b/rpz5shwv63.js new file mode 100644 index 0000000..12daf79 --- /dev/null +++ b/rpz5shwv63.js @@ -0,0 +1,41 @@ +var project = data; + +if (!project.loaded) { + return; +} + +/** + * Only respond to before_render events for my parent project + */ +if (project !== this.getParentProject()) { + return; +} + +if (!this.initialized) { + + /** + * Set some initialization code here + */ + this.totalTime = 0; + project.cameras[1].position.y = 10; + + this.initialized = true; +} + +if (project.applicationMode === R3.API.Project.APPLICATION_MODE_RUN) { + + this.totalTime += project.clock.delta; + + project.cameras[1].position.x = 15 * Math.sin(this.totalTime * 0.1); + project.cameras[1].position.z = 15 * Math.cos(this.totalTime * 0.1); + project.cameras[1].lookAt.x = 0; + project.cameras[1].lookAt.y = 0; + project.cameras[1].lookAt.z = 0; + + project.cameras[1].updateInstance('position'); + project.cameras[1].updateInstance('lookAt'); +} + +return null; + +//@ sourceURL=3d_project_1_code_before_render.js \ No newline at end of file