Лабораторная работа №1

Download Лабораторная работа №1

Post on 22-May-2015

93 views

Category:

Education

1 download

Embed Size (px)

TRANSCRIPT

1 Blockly

1 Blockly

-10

SVG

SVG

100%

200%

500%

Layer 1

h

r2

r1

Blockly

Blockly

Blockly

body {

margin: 0px;

background-color: #000000;

overflow: hidden;

}

();

var renderer;

var scene;

var camera;

var mesh;

init();

animate();

function init() {

renderer = new THREE.WebGLRenderer();

renderer.setSize( window.innerWidth, window.innerHeight );

document.body.appendChild( renderer.domElement );

camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 1000 );

camera.position.z = 400;

scene = new THREE.Scene();

var geometry = new THREE.CylinderGeometry( (40),(40),(120),(5),5 );

var texture = THREE.ImageUtils.loadTexture( 'textures/wglu_internal_missing_texture.png' );

Blockly()

texture.anisotropy = renderer.getMaxAnisotropy();

var material = new THREE.MeshBasicMaterial( { map: texture } );

mesh = new THREE.Mesh( geometry, material );

scene.add( mesh );

window.addEventListener( 'resize', onWindowResize, false );}

function onWindowResize() {

camera.aspect = window.innerWidth / window.innerHeight;

camera.updateProjectionMatrix();

renderer.setSize( window.innerWidth, window.innerHeight );}

function animate() {

requestAnimationFrame( animate );

mesh.rotation.x += 0.005;

mesh.rotation.y += 0.01;

renderer.render( scene, camera );

};

Blockly.Language.webgl3d_web_a18_prizma = {

category: 'WebGL3D',

helpUrl: 'file://localhost/W:/home/webgl/www/blockly/demos/webgl/webgl3d_webgl_a18_prizma.help.html',

init: function() {

this.setColour(290);

this.appendDummyInput()

.appendTitle("Prizma");

this.appendValueInput("radius")

.appendTitle(" Radius");

this.appendValueInput("height")

.appendTitle(" Height");

this.appendValueInput("count")

.appendTitle(" Count")

.appendTitle(new Blockly.FieldImage("../../media/Prizma.svg",64,48));

this.setTooltip('');

this.setPreviousStatement(true);

this.setNextStatement(true);

}

};

Blockly.Language.webgl_a17_html5 = {

category: 'WebGL3d',

helpUrl: 'http://www.example.com/',

init: function() {

this.setColour(220);

this.appendDummyInput()

.appendTitle("body");

this.appendStatementInput("NAME");

this.setPreviousStatement(true);

this.setTooltip('');

}

};

help.html

!