1 Star 0 Fork 13

shenzhenjinan / GuiLiteWeb

forked from idea4good / GuiLiteWeb 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.js 792 Bytes
一键复制 编辑 原始数据 按行查看 历史
idea4good 提交于 2019-08-04 11:26 . optimize code
let video;
let image;
let angle = 0;
function setup() {
video = createVideo(['assets/mcu-wave.mp4']);
video.elt.muted = true;
video.loop();
video.hide();
image = loadImage('assets/background.jpg')
createCanvas(800, 600, WEBGL);
}
function drawBoxWithVideo(){
texture(video);
box(200, 200, 200);
}
function drawBoxWithImage(){
texture(image);
box(200, 200, 200);
}
function drawCustomShap(){
background('rgb(100, 100, 100)');
fill(0)
//texture(image);
beginShape();
vertex(0, 0, 50, 0, 0);
vertex(100, 0, 50, 1, 0);
vertex(100, 100, 50, 1, 1);
vertex(0, 100, 50, 0, 1);
endShape(CLOSE);
}
function draw() {
rotateZ(0);
rotateX(0.5);
rotateY(angle * 0.1);
//drawBoxWithImage();
drawBoxWithVideo();
//drawCustomShap();
angle += 0.05;
}
JavaScript
1
https://gitee.com/shenzhenjinan/GuiLiteWeb.git
git@gitee.com:shenzhenjinan/GuiLiteWeb.git
shenzhenjinan
GuiLiteWeb
GuiLiteWeb
master

搜索帮助