Skip to content

Instantly share code, notes, and snippets.

Limes2018 flushpot1125

Block or report user

Report or block flushpot1125

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View orbitcontrol2-how-to.js
let canvas = document.querySelector('#myCanvas');
let controls = new OrbitControls(camera,canvas);
View orbitcontrol-how-to.js
const renderer = new THREE.WebGLRenderer({
canvas: document.querySelector('#myCanvas')
});
controls = new OrbitControls(camera,renderer.domElement);
View threejs-objimport.js
import * as THREE from 'three';
import {TrackballControls} from 'three/examples/jsm/controls/TrackballControls.js';
import { OBJLoader } from 'three/examples/jsm/loaders/OBJLoader.js';
import { MTLLoader } from 'three/examples/jsm/loaders/MTLLoader.js';
//スクリプトのロードが終わってからinitを実行させる
window.addEventListener('load', init);
let controls, scene, camera;
//Renderer
View threejs-index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>My first three.js app</title>
<style>
body { margin: 0; }
canvas { display: block; }
</style>
</head>
View threejs-min.js
import * as THREE from 'three';
//スクリプトのロードが終わってからinitを実行させる
window.addEventListener('load', init);
let scene, camera;
//Renderer
const renderer = new THREE.WebGLRenderer({
canvas: document.querySelector('#myCanvas')
View threejs-webpack.config.js
//Ref :https://qiita.com/riversun/items/d27f6d3ab7aaa119deab
const path = require("path");
module.exports = {
mode: 'development',
entry: {app: './src/index.js'},
output: {
path: path.join(__dirname, "./"),
filename: '[name].js',//[name]の部分にはentryで指定したキー(app)が入る
},
View networked-aframe-server.js
// Load required modules
const http = require("http"); // http server core module
const https = require("https");//Added by limes
const fs = require('fs');
const path = require("path");
const express = require("express"); // web framework external module
// Set process name
process.title = "networked-aframe-server";
View index.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Local Development</title>
<script src="https://code.jquery.com/pep/0.4.2/pep.min.js"></script>
<style>
html,
View index_mod.js
import { Engine} from "@babylonjs/core/Engines/engine";
import { Scene} from "@babylonjs/core/scene";
import { Vector3} from "@babylonjs/core/Maths/math";
import { FreeCamera} from "@babylonjs/core/Cameras/freeCamera";
import { HemisphericLight} from "@babylonjs/core/Lights/hemisphericLight";
import { Mesh} from "@babylonjs/core/Meshes/mesh";
import { GridMaterial} from "@babylonjs/materials/grid";
// Required side effects to populate the Create methods on the mesh class. Without this, the bundle would be smaller but the createXXX methods from mesh would not be accessible.
import "@babylonjs/core/Meshes/meshBuilder";
View index_mod_Effects.js
import {Effects} from './Effects';
const mesh = scene.rootNodes[0];
Effects.add(mesh,scene);
You can’t perform that action at this time.