tutorial processing 3d, translate, box, sphere, draw.doc


文档分类:IT计算机 | 页数:约2页 举报非法文档有奖
1/2
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/2
文档列表 文档介绍
TutorialProcessing3D,translate,box,sphere,,,theninvokesafunctionthatcalculatesanewpositionfortheballoon(asphere),:floatxd=2;floatyd=-1;floatzd=1;floatleftwall=300;floattopwall=250;floatbackwall=0;floatxwidth=410;floatywidth=310;floatzwidth=210;floatxpos=0;floatypos=0;floatzpos=0;Allbutthelastthree(xpos,ypos,andzpos),drawandtheprogrammer-,:callsoncedrawProcessing:callsforeveryframeballoondrawmoveballoonballoonvoidsetup(){size(800,600,P3D);frameRate(15);}voiddraw(){lights();background(250);stroke(0,0,255);translate(leftwall,topwall,backwall);noFill();box(xwidth,ywidth,zwidth);balloon();}voidballoon(){moveballoon();translate(xpos,ypos,zpos);fill(0);stroke(255,0,0);sphere(10);}voidmoveballoon(){xpos+=xd;ypos+=yd;zpos+=zd;if(xpos<-.5*xwidth)xd=-xd;if(xpos>.5*xwidth)xd=-xd;if(ypos<-.5*ywidth)yd=-yd;if(ypos>.5*ywidth)yd=-yd;if(zpos<-.5*zwidth)zd=-zd;i

tutorial processing 3d, translate, box, sphere, draw 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数2
  • 收藏数0 收藏
  • 顶次数0
  • 上传人wxc6688
  • 文件大小35 KB
  • 时间2020-05-18