ScratchData LogoScratchData
Back to Howtomakeausername's profile

Fully accurate 3d shadows from a light position (x,y,z)

HOHowtomakeausername•Created January 18, 2021
Fully accurate 3d shadows from a light position (x,y,z)
118
96
1590 views
View on Scratch

Instructions

WASDQE, ARROWS. The yellow cube is the light! This script finds where the shadow would be on a plane with height (h) from a given point (x,y,z) and a light position (lx,ly,lz). It works by basically shooting a ray from the light source to a point and then finding the point of intersection on a plane below the objects.

Description

Look inside, I have a whole sprite with just the script in it, and a detailed explanation of how this works ;). If you want to use this, chuck it in your backpack but make sure to give credit to me, @howtomakeausername for it.

Project Details

Project ID475106682
CreatedJanuary 18, 2021
Last ModifiedAugust 23, 2024
SharedJanuary 19, 2021
Visibilityvisible
CommentsAllowed