繁体   English   中英

ProcessingJS不以3D模式绘制图像

[英]ProcessingJS not drawing images in 3D mode

我正在尝试使用ProcessingJS在画布上绘制图像。 它在2D模式下可完美工作,但在3D模式下则不能。 该代码如下所示:

PImage img;

void setup(){
    size(600, 400, OPENGL);
    strokeWeight(1);
    noFill();
    frameRate(60);
    imageMode(CENTER);
    img = loadImage("img.png");
}

void draw(){      

     image(img, 20, 20);

}

有什么想法可能导致问题吗?

如果您使用的Processing.js版本早于1.3.0,那么此链接可能会解释为什么它不起作用:

https://processing-js.lighthouseapp.com/projects/41284/tickets/1511-image-doesnt-work-in-opengl-mode

否则,您可以尝试将图像作为纹理映射到多边形上,如以下示例所示:

http://processing.org/learning/3d/texture1.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM