1

我在 , 中编写了一个程序Processing 2.1.2来导入一个对象STL File并在固定坐标上旋转它。

我的程序运行良好,但与此同时我在底部终端上遇到了一个错误,即:

OpenGL error 1280 at bot beginDraw(): invalid enumerant

你能指导我如何摆脱这个错误吗?程序编码如下

import toxi.geom.*;
import toxi.geom.mesh.*;
import toxi.processing.*;
TriangleMesh mesh;
ToxiclibsSupport gfx;
void setup() {
  size(1000, 800,P3D);
  mesh=(TriangleMesh)new STLReader().loadBinary(sketchPath("check.stl"),STLReader.TRIANGLEMESH);
  gfx=new ToxiclibsSupport(this);

}
void draw() {

  background(51);
  translate(width/2,height/2,0);
  rotateX(radians(-4.35));   // Pitch
  rotateY(radians(180));    // Roll
  rotateZ(radians(180));   // Yaw
  directionalLight(192, 168, 128,0, -1000, -0.5);
  directionalLight(255, 64, 0, 0.5f, -0.5f, -0.1f);
  noStroke();
  scale(4);  
  gfx.mesh(mesh,false);
}
4

0 回答 0