0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

cesiumの作法 その6

Posted at

概要

cesiumの作法、調べてみた。
three.js使ってみた。

サンプルコード


var viewer = new Cesium.CesiumWidget('cesiumContainer', {
});
var scene;
var box;
var camera;
var renderer;
var light;
var width = window.innerWidth;
var height = window.innerHeight;
scene = new THREE.Scene();
box = new THREE.Mesh(new THREE.BoxGeometry(50, 50, 50), new THREE.MeshLambertMaterial({
  color: 0xff0000
}));
scene.add(box);
light = new THREE.DirectionalLight(0xffffff, 1); 
light.position.set(0, 100, 30);
scene.add(light);
camera = new THREE.PerspectiveCamera(45, width / height, 1, 1000);
camera.position.set(200, 100, 300);
camera.lookAt(box.position);  
renderer = new THREE.WebGLRenderer({
  alpha: true
});
renderer.setSize(width, height);
document.getElementById('threeContainer').appendChild(renderer.domElement);
function render() {
  requestAnimationFrame(render);
  renderer.render(scene, camera);
}
render();




成果物

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?