diff --git a/test/unit/visual/cases/webgl.js b/test/unit/visual/cases/webgl.js index 8d33862f14..652f061702 100644 --- a/test/unit/visual/cases/webgl.js +++ b/test/unit/visual/cases/webgl.js @@ -1243,6 +1243,76 @@ visualSuite('WebGL', function() { }); }); + visualSuite('3D Primitives', function() { + visualTest('cylinder() renders correctly', function(p5, screenshot) { + p5.createCanvas(100, 100, p5.WEBGL); + p5.background(255); + + p5.ambientLight(100); + p5.directionalLight(255, 255, 255, 0, 0, -1); + + p5.noStroke(); + p5.fill(200); + + p5.rotateX(p5.PI / 6); + p5.rotateY(p5.PI / 4); + + p5.cylinder(30, 60); + screenshot(); + }); + + visualTest('cone() renders correctly', function(p5, screenshot) { + p5.createCanvas(100, 100, p5.WEBGL); + p5.background(255); + + p5.ambientLight(100); + p5.directionalLight(255, 255, 255, 0, 0, -1); + + p5.noStroke(); + p5.fill(200); + + p5.rotateX(p5.PI / 6); + p5.rotateY(p5.PI / 4); + + p5.cone(30, 60); + screenshot(); + }); + + visualTest('ellipsoid() renders with non-uniform radii', function(p5, screenshot) { + p5.createCanvas(100, 100, p5.WEBGL); + p5.background(255); + + p5.ambientLight(100); + p5.directionalLight(255, 255, 255, 0, 0, -1); + + p5.noStroke(); + p5.fill(200); + + p5.rotateX(p5.PI / 6); + p5.rotateY(p5.PI / 4); + + p5.ellipsoid(20, 30, 40); + screenshot(); + }); + + visualTest('torus() renders correctly', function(p5, screenshot) { + p5.createCanvas(100, 100, p5.WEBGL); + p5.background(255); + + p5.ambientLight(100); + p5.directionalLight(255, 255, 255, 0, 0, -1); + + p5.noStroke(); + p5.fill(200); + + p5.rotateX(p5.PI / 6); + p5.rotateY(p5.PI / 4); + + p5.torus(30, 10); + screenshot(); + }); + }); + visualSuite('Tessellation', function() { visualTest('Handles nearly identical consecutive vertices', function(p5, screenshot) { p5.createCanvas(400, 400, p5.WEBGL); diff --git a/test/unit/visual/screenshots/WebGL/3D Primitives/cone() renders correctly/000.png b/test/unit/visual/screenshots/WebGL/3D Primitives/cone() renders correctly/000.png new file mode 100644 index 0000000000..31cb058247 Binary files /dev/null and b/test/unit/visual/screenshots/WebGL/3D Primitives/cone() renders correctly/000.png differ diff --git a/test/unit/visual/screenshots/WebGL/3D Primitives/cone() renders correctly/metadata.json b/test/unit/visual/screenshots/WebGL/3D Primitives/cone() renders correctly/metadata.json new file mode 100644 index 0000000000..2d4bfe30da --- /dev/null +++ b/test/unit/visual/screenshots/WebGL/3D Primitives/cone() renders correctly/metadata.json @@ -0,0 +1,3 @@ +{ + "numScreenshots": 1 +} \ No newline at end of file diff --git a/test/unit/visual/screenshots/WebGL/3D Primitives/cylinder() renders correctly/000.png b/test/unit/visual/screenshots/WebGL/3D Primitives/cylinder() renders correctly/000.png new file mode 100644 index 0000000000..be5edeec06 Binary files /dev/null and b/test/unit/visual/screenshots/WebGL/3D Primitives/cylinder() renders correctly/000.png differ diff --git a/test/unit/visual/screenshots/WebGL/3D Primitives/cylinder() renders correctly/metadata.json b/test/unit/visual/screenshots/WebGL/3D Primitives/cylinder() renders correctly/metadata.json new file mode 100644 index 0000000000..2d4bfe30da --- /dev/null +++ b/test/unit/visual/screenshots/WebGL/3D Primitives/cylinder() renders correctly/metadata.json @@ -0,0 +1,3 @@ +{ + "numScreenshots": 1 +} \ No newline at end of file diff --git a/test/unit/visual/screenshots/WebGL/3D Primitives/ellipsoid() renders with non-uniform radii/000.png b/test/unit/visual/screenshots/WebGL/3D Primitives/ellipsoid() renders with non-uniform radii/000.png new file mode 100644 index 0000000000..0392b2ddb5 Binary files /dev/null and b/test/unit/visual/screenshots/WebGL/3D Primitives/ellipsoid() renders with non-uniform radii/000.png differ diff --git a/test/unit/visual/screenshots/WebGL/3D Primitives/ellipsoid() renders with non-uniform radii/metadata.json b/test/unit/visual/screenshots/WebGL/3D Primitives/ellipsoid() renders with non-uniform radii/metadata.json new file mode 100644 index 0000000000..2d4bfe30da --- /dev/null +++ b/test/unit/visual/screenshots/WebGL/3D Primitives/ellipsoid() renders with non-uniform radii/metadata.json @@ -0,0 +1,3 @@ +{ + "numScreenshots": 1 +} \ No newline at end of file diff --git a/test/unit/visual/screenshots/WebGL/3D Primitives/torus() renders correctly/000.png b/test/unit/visual/screenshots/WebGL/3D Primitives/torus() renders correctly/000.png new file mode 100644 index 0000000000..ba8c2db3bc Binary files /dev/null and b/test/unit/visual/screenshots/WebGL/3D Primitives/torus() renders correctly/000.png differ diff --git a/test/unit/visual/screenshots/WebGL/3D Primitives/torus() renders correctly/metadata.json b/test/unit/visual/screenshots/WebGL/3D Primitives/torus() renders correctly/metadata.json new file mode 100644 index 0000000000..2d4bfe30da --- /dev/null +++ b/test/unit/visual/screenshots/WebGL/3D Primitives/torus() renders correctly/metadata.json @@ -0,0 +1,3 @@ +{ + "numScreenshots": 1 +} \ No newline at end of file