This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var loader = new THREE.GLTFLoader(); | |
loader.load( | |
'models/sakana/sakana.gltf', | |
function ( gltf ) { | |
console.log(gltf.scene); | |
scene.add(gltf.scene); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const divNum = 12;//波の分割数 | |
const waveNum = 1;//波の数 | |
function planeAnim(){ | |
for (var i = 0; i < planeGeo.vertices.length; i++) { | |
if(Math.floor(i/(divNum+1))==1){//列ごとに処理 | |
planeGeo.vertices[i].y=Math.sin((clock.getElapsedTime()+(i/6))*2)*10; | |
}else{ | |
planeGeo.vertices[i].y=Math.sin((clock.getElapsedTime()+(i/6))*2)*20; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const divNum = 12;//波の分割数 | |
const waveNum = 1;//波の数 | |
//ベジェ曲線の制御点の座標 | |
var p1 = new THREE.Vector3(); | |
var p2 = new THREE.Vector3(); | |
var s1 = new THREE.Vector3(); | |
var s2 = new THREE.Vector3(); | |
function bezer(p1,p2,s1,s2,t){//三次ベジェ曲線の座標を返す |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var simplex = new SimplexNoise(); | |
const divNum = 50;//波の分割数 | |
const waveNum = 5;//波の数(波の数-1) | |
function planeAnim(){ | |
//var simplex = new SimplexNoise(); | |
for (var i = 0; i < planeGeo.vertices.length; i++) { | |
var divNumIndex = i % divNum;//波の節のインデックス(左から0番~[divNum]番) | |
var waveNumIndex = Math.floor(i/(divNum+1)) ;//波の数のインデックス(0番~[waveNum]番) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="x-shader/x-vertex" id="vshader"> | |
varying vec3 vNormal; | |
varying vec3 pos; | |
void main() | |
{ | |
vNormal=normalMatrix * normal; | |
pos = position; | |
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="x-shader/x-vertex" id="vshader"> | |
varying vec3 vNormal; | |
varying vec3 pos; | |
void main() | |
{ | |
vNormal=normalMatrix * normal; | |
pos = position; | |
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="x-shader/x-vertex" id="vshader"> | |
varying vec3 vNormal; | |
varying vec3 pos; | |
void main() | |
{ | |
vNormal=normalMatrix*normal; | |
pos = position; | |
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>title</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/102/three.min.js" ></script> | |
<link rel="stylesheet" type="text/css" href="style.css" /> | |
</head> | |
<body> | |
<!--ここにシェーダとか書く--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*カテゴリの色変更*/ | |
a.category-3DCG{ | |
background-color:#002030; | |
color:white; | |
} | |
a.category-プログラミング{ | |
background-color:#002030; | |
color:white; | |
} | |
a.category-デザイン{ |
OlderNewer