我的应用程序有一个分屏模式,其中只有一半的屏幕用于显示 3d 场景。所以我想把消失点放在左半边的中间。
我已经尝试了各种组合,camera()
但是translate()
消失点并没有从草图窗口的中心移动一个像素..
void setup(){
size(800,400, P3D);
fill(255,120);
}
void draw(){
background(111);
float camEyeX = 0;
float camEyeY = 400;
float camEyeZ = (height/2) / tan(PI/6);
float camCenterX = 0;
float camCenterY = -200;
float camCenterZ = 0;
float camUpX = 0;
float camUpY = 1;
float camUpZ = 0;
pushMatrix();
camera( camEyeX, camEyeY, camEyeZ, camCenterX, camCenterY, camCenterZ, camUpX, camUpY, camUpZ );
translate( -200, 0, 0);
rectMode(CENTER);
rect(0,0, 800,400);
rect(0,0, 100,100);
popMatrix();
hint(DISABLE_DEPTH_TEST);
rectMode(CORNER);
rect(400,0, 400,400);
hint(ENABLE_DEPTH_TEST);
}
关于这个话题,我刚刚发现十年前提出的这个悬而未决的问题......有谁知道这是否有可能实现?