Skip to content

Instantly share code, notes, and snippets.

@izumiikezaki
Created March 3, 2019 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save izumiikezaki/c43098733dc5a7e33a18dad5687b1ec1 to your computer and use it in GitHub Desktop.
Save izumiikezaki/c43098733dc5a7e33a18dad5687b1ec1 to your computer and use it in GitHub Desktop.
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;
}
}
planeGeo.verticesNeedUpdate=true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment