3 Tetrahedra Compound - a Ray Tracer

3 Tetrahedra Compound - a Ray Tracer

by Scratch-Minion

👁 33 ❤️ 5 ⭐ 6 🔄 0
Created: May 13, 2021 Last modified: Sep 13, 2021 Shared: Sep 13, 2021

Description

Raytraced Intersecting Polyhedra studio: https://scratch.mit.edu/studios/30286682/ https://en.wikipedia.org/wiki/Compound_of_three_tetrahedra The Cartesian coordinates of a hexagonal antiprism, centered on the origin and having edge length 2, are: (±1, ±√3, √2) (±2, 0, √2) (±√3, ±1, −√2) (0, ±2, −√2) My Ray Tracing Projects studio: https://scratch.mit.edu/studios/26312219/ Ray Madness - a super raytracing & raycasting studio: https://scratch.mit.edu/studios/25849210/

Instructions

* Project runs much faster in TurboWarp: https://turbowarp.org/530291133?turbo * Else use Turbo Mode! (<Shift> key + Green Flag) Press <1> to view in best resolution (slow) Press <2> for medium resolution (slowish) Press <5> for low resolution (fast) like starting picture The 3 differently coloured tetrahedra intersect each other so that each triangle face is partially in front of and partially behind several other triangle faces. This makes the object hard to draw. It is easier to raytrace to each point on the screen and find the closest of the 12 triangles that make up the 3 tetrahedra compound and colour the point to match. Compound of 3 Tetrahedra: https://en.wikipedia.org/wiki/Compound_of_three_tetrahedra The Cartesian coordinates of a hexagonal antiprism, centered on the origin and having edge length 2, are: (±1, ±√3, √2) (±2, 0, √2) (±√3, ±1, −√2) (0, ±2, −√2) A "Ray Tracer" traces rays from the viewer through each pixel on the screen and calculates which object it hits first in 3D space (ie. which object is closest). The pixel is coloured with the colour of that object. For a ray to each (x,y) point on the screen, the code checks if and where the ray intersects each of the triangles that make up the 3 Tetrahedra Compound. The Z Intersect coordinate is calculated for each triangle intersection. The (x,y) point on the screen is coloured with the colour of the triangle with its Z Intersect coordinate closest to the viewer. My Ray Tracing Projects studio: https://scratch.mit.edu/studios/26312219/ Ray Madness - a super raytracing & raycasting studio: https://scratch.mit.edu/studios/25849210/

Project Details

Visibility
Visible
Comments
Enabled

More Cool Projects

Project thumbnail
View Project

Geometry Dash Starsight

by iPhone_ATT_TWC115

Project thumbnail
View Project

Chuck E. Cheese's: Pizza Time Horror

by LegendaryMaker2010

Project thumbnail
View Project

Mario Tennis: Rally Challenge

by MarioFan3629

Project thumbnail
View Project

Horror Movies || #Animations #Stories #All #Music #Art #Games

by -microanimations-

Project thumbnail
View Project

Rainbow 6 Siege Random Operator Selector R6SROS

by ASDFboy_Legacy

Project thumbnail
View Project

Picture Blurrifier V3 (1.0)

by finnagin5

Project thumbnail
View Project

Wave

by marin0298

Project thumbnail
View Project

☁️ SMASH ROYALE Online! ☁️ #games #multiplayer #royale #battle #all

by Supercube_123

Project thumbnail
View Project

Trevor Henderson Monsters V.1

by cs1779933

Project thumbnail
View Project

Death Toll | Friday Night Funkin' Lullaby PLAYABLE

by ItsTappyHappy

Project thumbnail
View Project

ダダサバイバーver.2.s

by scratchegg1414

Project thumbnail
View Project

JR東日本のグルメレース

by momo163

Project thumbnail
View Project

Playkids Band 8 (Remake) (FINALLY HERE)

by SharkyBlues3rd

Project thumbnail
View Project

Playkids Band 13 (Remake)

by jboer95

Project thumbnail
View Project

TVOkids Logo Bloopers All Quads: DVD Menu

by jl381367

Project thumbnail
View Project

Typhoon at the Doubloon! - An entry for TSAC4

by Burgnew_On_A_Laptop

Project thumbnail
View Project

Cuphead: The Cyclops in "Rugged Ridge Royale!" (W.I.P)

by NinjaBenM

Project thumbnail
View Project

Battle! - [Pre-Alpha]

by BFBclub_om-nom

Project thumbnail
View Project

SMB | Ep. 20

by PruinaeDraco

Project thumbnail
View Project

Ultra Numberblocks Night 2020 remix

by Uaeueememmmemmemmmel

Project thumbnail
View Project

Koven x ROY KNOX - About Me [NCS Release]

by sochanpiko

Project thumbnail
View Project

マイクラ実況Part8エンドポータルの先に進むぞ!

by ultimaterocking

Project thumbnail
View Project

Gomoku With AI 4

by -present-

Project thumbnail
View Project

Beat Up Bonzi Buddy REBOOTED v1 remix

by everton_trader