Questions tagged [3d]

For challenges involving either three-dimensional graphics, three-dimensional geometry or spatial data structures in three dimensions (e.g. octrees).

Filter by
Sorted by
Tagged with
11 votes
4 answers
362 views

Generate the vertices of a geodesic sphere

As in this challenge, the task is to generate the vertices of a polyhedron. The polyhedron here is the one obtained by dividing a regular icosahedron's triangular faces into smaller triangles so that ...
Karl's user avatar
  • 621
5 votes
2 answers
871 views

How spherical is my ellipsoid?

Define the (unnormalised) Willmore energy of a surface as the integral of squared mean curvature over it: $$W=\int_SH^2\,dA$$ For surfaces topologically equivalent to a sphere \$W\ge4\pi\$, and \$W=4\...
Parcly Taxel's user avatar
  • 3,707
9 votes
5 answers
264 views

CGAC2022 Day 22: Present stack headache, Part 2

Part of Code Golf Advent Calendar 2022 event. See the linked meta post for details. Santa has a bunch of presents wrapped in cuboid boxes of various sizes. As his sled flies above a chimney, a stack ...
Bubbler's user avatar
  • 73.8k
9 votes
7 answers
419 views

CGAC2022 Day 21: Present stack headache

Part of Code Golf Advent Calendar 2022 event. See the linked meta post for details. challenge idea by emanresu A Santa has a bunch of presents wrapped in cuboid boxes of various sizes. As his sled ...
Bubbler's user avatar
  • 73.8k
21 votes
18 answers
5k views

Convince me Gabriel's Horn is possible

From Wikipedia, Gabriel's Horn is a particular geometric figure that has infinite surface area but finite volume. I discovered this definition in this Vsauce's video (starting at 0:22) where I took ...
ihavenoidea's user avatar
  • 1,219
37 votes
20 answers
7k views

I give you ascii-art, you make it pseudo-3d

Do you know the optical effect of a tridimensional hand painted whit horizontal lines? Examples This challenge consists of making something like that effect with ascii, and transforming one 2d input ...
ZeroCodeException's user avatar
22 votes
26 answers
3k views

Print a 3D shape

Write a program or a function to print the following cube (if you allow me to call it so) in different sizes: ...
anotherOne's user avatar
  • 1,081
13 votes
6 answers
712 views

Ellipsoid surface area

Related: Ellipse circumference Introduction An ellipsoid (Wikipedia / MathWorld) is a 3D object analogous to an ellipse on 2D. Its shape is defined by three principal semi-axes \$a,b,c\$: $$ \frac{x^2}...
Bubbler's user avatar
  • 73.8k
16 votes
7 answers
1k views

Counting painted sides of cubic shapes

Sandbox Many of us have seen math problems where a shape made of unit cubes is dipped in paint, and the answer is the number of painted sides. We'll generalize that problem in this challenge. Input A ...
Rushabh Mehta's user avatar
14 votes
4 answers
959 views

Reconstruct a 3d arrangement of cubes from two of its projections

Setup Take the following 4x4x4 cube along with a 2D view of 3 of its faces, with a common 1x1x1 cube highlighted: The arrows ...
RGS's user avatar
  • 14k
21 votes
2 answers
1k views

Golf Lathe Machine

You probably know what a Turing Machine is but do you know what is a Turning Machine (lathe)? Ok you already know.. and what about a Golf Turning Machine ?? Ok I tell you.. A Golf Turning Machine is ...
AZTECCO's user avatar
  • 10.7k
18 votes
2 answers
1k views

ASCII TURNED SHAPE

How can we depict a turned shape simply and nicely using ascii characters in 3D space? I suggest this method : Instead of a circle we use a square rotated by 45° for the cutting section so that we ...
AZTECCO's user avatar
  • 10.7k
14 votes
6 answers
820 views

Binary self-rotation

Given a binary 3D array, for each layer, cyclically rotate up each of its columns as many steps as indicated by the binary encoding of the columns of the layer above it, and then cyclically rotate ...
Adám's user avatar
  • 29.9k
32 votes
2 answers
859 views

Will Mario fall into the Shrinking Satellite? (Diagram added)

Super Mario Galaxy features two rhombicuboctahedron-shaped* planets tiled with platforms that shrink as Mario runs across. Should Mario fall into a triangular hole or a gap left by a tile he ...
darrylyeo's user avatar
  • 7,859
0 votes
1 answer
1k views

Menger Sponge Generator [duplicate]

Challenge My challenge, is for you to generate a Menger Sponge based on the level/iteration given. You need to draw it in ...
Noah Cristino's user avatar
34 votes
1 answer
2k views

Totally Cubular

Create a program or function to unjumble a 9x9x9 cube of digits by rotating individual 3x3 cubes within it. This is similar to (but, I suspect, a bit harder than) my Flippin' Squares question. Input ...
Gareth's user avatar
  • 11.3k
5 votes
3 answers
268 views

Contiguous Block Count

Count the number of contiguous blocks within a given 3D input. Input The input will consist of one or more rectangles of characters separated by blank lines. Each rectangle represents a cross ...
Gareth's user avatar
  • 11.3k
21 votes
8 answers
895 views

Wrap a seasonal present

Task Given a wrapper element and a non-jagged 3D array, wrap the array top, bottom, and all-around. You must handle both character and numeric data, but the wrapper and the present will have the same ...
Adám's user avatar
  • 29.9k
4 votes
6 answers
439 views

Find the intersection point of a plane and ray

Given a ray with a point and a vector and a plane with a point and a normal vector to the plane. You have to find the intersection point of the plane and the ray.. So your job if you choose to accept ...
Kishan Kumar's user avatar
12 votes
3 answers
2k views

Draw a simple cube

We don't have a single challenge about drawing a real 3 dimensional cube, so here it goes: Challenge Your task is to draw a rotated, cube with perspective. It can be in a separate window or as an ...
Bálint's user avatar
  • 1,865
13 votes
8 answers
539 views

Typesetting multidimensional labels

In a steam-punk multidimensional world, our boss wants to affix printed index labels to each drawer in our conglomerate's multidimensional file cabinet. The boss wants to typeset the entire label ...
Adám's user avatar
  • 29.9k
16 votes
1 answer
3k views

Ray-trace a shiny sphere

I downloaded POV-ray and rendered this shiny metal sphere 90s style: Your task is to do the same thing, but to do it by implementing the rendering engine yourself in as few bytes as possible. You don'...
N. Virgo's user avatar
  • 7,232
3 votes
1 answer
414 views

GPS: Golfed Positioning System

Your mission, should you choose to accept it, is to write code for a GPS receiver. Input The current time, as nanoseconds from the Unix epoch. [EDIT: This is optional, please state whether you ...
user avatar
16 votes
8 answers
861 views

Tetrahedron Surface Area

The challenge This challenge is very straightforward. Given four 3-dimensional points, calculate the surface area of the tetrahedron that they form. This is code-golf, so shortest code wins. Standard ...
stokastic's user avatar
  • 981
33 votes
10 answers
11k views

3D: Discrete Dogfighting Duel (Now open to non Java submissions)

UPDATE: isSuicidal() was added to the plane class, this allows you to check if a plane is on an irreversible collision course with the walls!! UPDATE: updateCoolDown() separated from simulateMove() ...
overactor's user avatar
  • 3,580
35 votes
6 answers
3k views

Check if three letters can form a "Godel-Escher-Bach cube"

This question is inspired by the cover of the book "Godel, Escher, Bach": The challenge here is to write a function that tells if three given letters can produce a 3D sculpture that can be read from ...
xem's user avatar
  • 5,827