所以我正在用 p5js 库和另一个大部分未知但我确信这不是问题的游戏。代码就这么简单:
var button;
var player;
var x = 0, y = 0.5, z = 0
function setup() {
createCanvas3D(windowWidth, windowHeight);
background3D("#ffffff");
changeCamera(ORTHOGRAPHIC);
hideToolbox();
console.log(width, height)
hideGrid()
noStroke();
fill(255);
ellipseMode(RADIUS);
diffuse("orange");
roughness(0.1);
player = sphere(x, y, z, 0.5);
var name = prompt()
player.name = name
console.log(player)
}
function draw() {
setCamera(10 + player.position.x, 10 + player.position.y, 10 + player.position.z, player.position.x, player.position.y, player.position.z)
}
function windowResized() {
resizeCanvas3D(windowWidth, windowHeight);
}
将在 pc 和 android 上运行良好。这意味着球显示为橙色。然而,在像 Ipad 这样的原始 IOS 设备上,一切都显示为黑色。我也检查了 chrome 控制台日志,似乎没有错误。
如果有人知道如何解决它,谢谢你,因为它真的很困扰我,我必须在星期天之前完成这个项目。