Processing 教程(13) 我的3D开山之作!

本文是Processing 3D编程的初探,通过实例介绍如何使用Processing创建简单的3D作品,适合初学者了解3D绘图的基础概念和技术。


float t;
void setup(){
//size(720,404, P3D);
fullScreen(P3D);
t=0;
textSize(32);
}


void draw(){
  background(20);
  noFill();
  stroke(#74F599);
  
  lights();
  pushMatrix();
  translate(width/2, height/2, 200 * sin(t));
  rotateY(t);
  rotateX(PI/6);
  sphere(300);
  fill(#74F599);
  textMode(CENTER);
  text(str(second()*19840921),0,0,0);
  popMatrix();
  String time_now = str(year()) + " - " + str(month()) + " - " + str(day()) + " - " + str(hour()) +" : " + str(minute()) +" : " + str(second());
  text(time_now,100,150,0);
  text("Frame count: " + str(frameCount),100,200,0);
  t = (t + 0.01) % TWO_PI;
}


void mouseClicked(){  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值