Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » 3D on scratch, And how it's professionally accomplished
- playerPl47
-
Scratcher
10 posts
3D on scratch, And how it's professionally accomplished
ok, sorry, but i was just trying to make sure he got it, because he normally gets multiple notifications, and is more likely to notice that suggestion if i respond to him, and it was the only post from GL00B here i could find#534Please don't make big quotes like that, it uses a lot of space that is not needed
GL00B i bet very much, even with a PACKAGED turbowarp project, itll still be a little laggy for other non-powerful devices! so you should add occlusion culling! it will definetely optimize your engine! thanks for reading!
It's a really good suggestion tho ! I don't know if he already uses it in his 3D projects, but if not, he should definitely work on adding this
- Blueismyfav22
-
Scratcher
7 posts
3D on scratch, And how it's professionally accomplished
Well. In Order To Get 3D Making 3D Can Be Really Hard… But I Did It.
I Made This Cool Coffee Cup Using 4 Costumes! Over Here! https://scratch.mit.edu/projects/1249706641/ Or If You Want To. You Can See Inside What I Made And The Code Is Cool! Even @Tomas999ASA Liked It! Or If You Want To (Again) You Can Tap Or Click My PFP To See What I Recently Made!
I Made This Cool Coffee Cup Using 4 Costumes! Over Here! https://scratch.mit.edu/projects/1249706641/ Or If You Want To. You Can See Inside What I Made And The Code Is Cool! Even @Tomas999ASA Liked It! Or If You Want To (Again) You Can Tap Or Click My PFP To See What I Recently Made!- Blueismyfav22
-
Scratcher
7 posts
3D on scratch, And how it's professionally accomplished
So I Know How To Make 3D! 

Last edited by Blueismyfav22 (Dec. 1, 2025 00:06:01)
- ultracat31
-
Scratcher
36 posts
3D on scratch, And how it's professionally accomplished
Well. In Order To Get 3D Making 3D Can Be Really Hard… But I Did It.Well, here we go again, cue people getting angry because it's technically 2.5D.I Made This Cool Coffee Cup Using 4 Costumes! Over Here! https://scratch.mit.edu/projects/1249706641/ Or If You Want To. You Can See Inside What I Made And The Code Is Cool! Even @Tomas999ASA Liked It! Or If You Want To (Again) You Can Tap Or Click My PFP To See What I Recently Made!
- hashdashpotato
-
Scratcher
1000+ posts
3D on scratch, And how it's professionally accomplished
Yes. I swear I read something that said that multiple 2D objects layered would equal a 3D one though.Well. In Order To Get 3D Making 3D Can Be Really Hard… But I Did It.Well, here we go again, cue people getting angry because it's technically 2.5D.I Made This Cool Coffee Cup Using 4 Costumes! Over Here! https://scratch.mit.edu/projects/1249706641/ Or If You Want To. You Can See Inside What I Made And The Code Is Cool! Even @Tomas999ASA Liked It! Or If You Want To (Again) You Can Tap Or Click My PFP To See What I Recently Made!
- ultracat31
-
Scratcher
36 posts
3D on scratch, And how it's professionally accomplished
Yeah, technically it's 2.5D.Yes. I swear I read something that said that multiple 2D objects layered would equal a 3D one though.Well. In Order To Get 3D Making 3D Can Be Really Hard… But I Did It.Well, here we go again, cue people getting angry because it's technically 2.5D.I Made This Cool Coffee Cup Using 4 Costumes! Over Here! https://scratch.mit.edu/projects/1249706641/ Or If You Want To. You Can See Inside What I Made And The Code Is Cool! Even @Tomas999ASA Liked It! Or If You Want To (Again) You Can Tap Or Click My PFP To See What I Recently Made!
- hashdashpotato
-
Scratcher
1000+ posts
3D on scratch, And how it's professionally accomplished
I'm working on a top down game using layers and it works for it's purposes. But yes in all technicality I agree.Yeah, technically it's 2.5D.Yes. I swear I read something that said that multiple 2D objects layered would equal a 3D one though.Well. In Order To Get 3D Making 3D Can Be Really Hard… But I Did It.Well, here we go again, cue people getting angry because it's technically 2.5D.I Made This Cool Coffee Cup Using 4 Costumes! Over Here! https://scratch.mit.edu/projects/1249706641/ Or If You Want To. You Can See Inside What I Made And The Code Is Cool! Even @Tomas999ASA Liked It! Or If You Want To (Again) You Can Tap Or Click My PFP To See What I Recently Made!
- br-0
-
Scratcher
6 posts
3D on scratch, And how it's professionally accomplished
https://scratch.mit.edu/projects/1238498959/editor
can someone please help me with a rotation issue in my codingbio-inspired 3D engine?
details are in the project, you can ask if there's anything you need.
can someone please help me with a rotation issue in my codingbio-inspired 3D engine?
details are in the project, you can ask if there's anything you need.
- _-ValX-_
-
Scratcher
500+ posts
3D on scratch, And how it's professionally accomplished
ok, sorry, but i was just trying to make sure he got it, because he normally gets multiple notifications, and is more likely to notice that suggestion if i respond to him, and it was the only post from GL00B here i could findActually, he get the exact same notification no matter if you respond to him or not

He might just be really busy wt glue3D, but Im sure he’s gonna see your post anytime soon
- RyRyWinner
-
Scratcher
9 posts
3D on scratch, And how it's professionally accomplished
Too much stuff. i am very very very confused and how would you even make the map?I always wondered how I could do something like line intersection raycasting because I don't know how that works. how does it detect collisions like that? I only know step by step or DDA. how does it know where the collision is??? please teach me or give me something to tell me how it works.
Glad you're interested! Since you know how to code a DDA raycaster, I'm really sure that you use vectors for it. Your Line intersection raycaster will have the same code as your normal DDA raycaster up until the actual loop. there, you will be checking a list that has your map data, cycling through it. you won't be using a voxel list, or a tile list, nope, just a list that has your data in certain packets that you can cycle through by the length of the packet. so simply:
( Wall_index * ( Packet_length ) + Wall_attribute [ this is where you store the x1,y1,z2,texture,height,anything you can think of. ) of
then you will use a line intersection formula, to find the intersection between 2 lines. one will be your ray, and the other will be the wall in the list. you cycle through the list and you will have checked intersection with the rays. the formula i use is this one :
https://www.youtube.com/watch?v=bvlIYX9cgls
You will use the alpha and beta to determine the Distance and the U coordinate in the texture of that wall. Thats all
****note****
you will realise the walls are NOT sorted, so you will need to use a z buffer, which will limit the y axis's resolution too. it will also greatly reduce the performance, so code it right and avoid extra calculations as much as possible!
Okay, lets simplify it. imagine the ray in a normal raycaster as a bullet that keeps moving till it hits something. right?
well, in our line segment raycaster, there is no bullet. there is just a laser beam, that instantly shows!
this laser beam checks if any lines are touching it. forget about making the map now, just tell me, is this clear? you are not moving till you hit a wall, you already hit the wall ever since the “beam” spawned, which is just a really long line that starts at your camera's position and it's end is a point that's equal to your vector + camera position.
I've coded a rasterizer before, but I've never heard of this method! So- lemme make sure I got this right- the “beam” (a line with a slope of… well just enough for a pixel's length) is just going through all the triangles in the project, from closest to farthest, and checks if it “collides” at any point. I do have a few concerns tho-
1- This sounds kinda like true 3D, so I think i got something wrong ._.
2- How do you know if a triangle is in collision with a line? Is there a magical equation for this, or is it a really long matrix-equating system-lagging program-of-doom that will make me wanna die
3- Why would someone use this instead of Rasterizing? Excluding the fact that it's easier than BSP trees (*shudder*), I don't see why it's better.
I'm really interested in the concept. I've been recoding my rasterizer from scratch (“Lol, from scratch. Tehehe”) to make it more lag efficient and… understandable (don't look at my current one's code ._.), but if this is a better way of doing 3d, I'd love to try it!
- Neputek
-
Scratcher
1 post
3D on scratch, And how it's professionally accomplished
Hi, i'm curious if you make games in for example unity or sth, i'll love to play actual games made by you 

- carvabra000
-
Scratcher
54 posts
3D on scratch, And how it's professionally accomplished
Hi, i'm curious if you make games in for example unity or sth, i'll love to play actual games made by youas if scratch games arent real games
- mikhail_a_m
-
Scratcher
31 posts
3D on scratch, And how it's professionally accomplished
why do most engines, or at least line rendering things similar to @CodingBio's, dont make the line grow thicker as they get closer?
- mikhail_a_m
-
Scratcher
31 posts
3D on scratch, And how it's professionally accomplished
just curious, would it be texture mapping, if we use what i described earlier, abut for textures.
What I mean by that is giving verticies a color depending which part of the texture it is, and then giving it a size based on how away it is from the camera. I know this is unoptimized, but after learning about what Carmack did with Catacomb 3D for textures, I got interested
What I mean by that is giving verticies a color depending which part of the texture it is, and then giving it a size based on how away it is from the camera. I know this is unoptimized, but after learning about what Carmack did with Catacomb 3D for textures, I got interested
- donutscode
-
Scratcher
3 posts
3D on scratch, And how it's professionally accomplished
i figured out how too, i just needed to magnify the tris to the screen proportions
- ultracat31
-
Scratcher
36 posts
3D on scratch, And how it's professionally accomplished
why do most engines, or at least line rendering things similar to @CodingBio's, dont make the line grow thicker as they get closer?Mostly because Tri Fillers make it unnecessary.
- playerPl47
-
Scratcher
10 posts
3D on scratch, And how it's professionally accomplished
oh, well thats weird, cause ive had a forum (on an old account, so IDK what is now lol) but i would normally get double notifications when someonme replied to ME vs when they just said summ in the postok, sorry, but i was just trying to make sure he got it, because he normally gets multiple notifications, and is more likely to notice that suggestion if i respond to him, and it was the only post from GL00B here i could findActually, he get the exact same notification no matter if you respond to him or not
He might just be really busy wt glue3D, but Im sure he’s gonna see your post anytime soon
also i've been woking on learning more 3D! so just wanna say that (also don't tell anyone but i'm not posting sensory-3 for a LOOOONG long time *sensory is a 3D clone-based game series i've been working on*)
- ultracat31
-
Scratcher
36 posts
3D on scratch, And how it's professionally accomplished
Scratch games are real games, even though it is pretty agreed upon that it isn't a real programming language. Although Neputek likely meant original game.Hi, i'm curious if you make games in for example unity or sth, i'll love to play actual games made by youas if scratch games arent real games
- GL00B
-
Scratcher
99 posts
3D on scratch, And how it's professionally accomplished
Too much stuff. i am very very very confused and how would you even make the map?I always wondered how I could do something like line intersection raycasting because I don't know how that works. how does it detect collisions like that? I only know step by step or DDA. how does it know where the collision is??? please teach me or give me something to tell me how it works.
Glad you're interested! Since you know how to code a DDA raycaster, I'm really sure that you use vectors for it. Your Line intersection raycaster will have the same code as your normal DDA raycaster up until the actual loop. there, you will be checking a list that has your map data, cycling through it. you won't be using a voxel list, or a tile list, nope, just a list that has your data in certain packets that you can cycle through by the length of the packet. so simply:
( Wall_index * ( Packet_length ) + Wall_attribute [ this is where you store the x1,y1,z2,texture,height,anything you can think of. ) of
then you will use a line intersection formula, to find the intersection between 2 lines. one will be your ray, and the other will be the wall in the list. you cycle through the list and you will have checked intersection with the rays. the formula i use is this one :
https://www.youtube.com/watch?v=bvlIYX9cgls
You will use the alpha and beta to determine the Distance and the U coordinate in the texture of that wall. Thats all
****note****
you will realise the walls are NOT sorted, so you will need to use a z buffer, which will limit the y axis's resolution too. it will also greatly reduce the performance, so code it right and avoid extra calculations as much as possible!
Okay, lets simplify it. imagine the ray in a normal raycaster as a bullet that keeps moving till it hits something. right?
well, in our line segment raycaster, there is no bullet. there is just a laser beam, that instantly shows!
this laser beam checks if any lines are touching it. forget about making the map now, just tell me, is this clear? you are not moving till you hit a wall, you already hit the wall ever since the “beam” spawned, which is just a really long line that starts at your camera's position and it's end is a point that's equal to your vector + camera position.
I've coded a rasterizer before, but I've never heard of this method! So- lemme make sure I got this right- the “beam” (a line with a slope of… well just enough for a pixel's length) is just going through all the triangles in the project, from closest to farthest, and checks if it “collides” at any point. I do have a few concerns tho-
1- This sounds kinda like true 3D, so I think i got something wrong ._.
2- How do you know if a triangle is in collision with a line? Is there a magical equation for this, or is it a really long matrix-equating system-lagging program-of-doom that will make me wanna die
3- Why would someone use this instead of Rasterizing? Excluding the fact that it's easier than BSP trees (*shudder*), I don't see why it's better.
I'm really interested in the concept. I've been recoding my rasterizer from scratch (“Lol, from scratch. Tehehe”) to make it more lag efficient and… understandable (don't look at my current one's code ._.), but if this is a better way of doing 3d, I'd love to try it!
1- it's not 3D, and there are No triangles, it's just 2D lines. These 2D line intersections do the same as normal raycasters, turning their distances into a vertical line based on that distance
2- it's a long procedure, and it involves other things than just detecting an intersection. again, NO triangles in the scene
3- I don't know for anyone else, but I don't reuse my own code / borrow from others. This way, I'd have to recreate the entire engine every time I make a new game. this ensures I fix everything from the start and make everything faster than the last attempt. That's why I go with raycasting in general, It looks 3D, It's super fast, it's correctly texture mapped, it comes with clipping ready, it comes with accurate z distances too, and it relies on smart tricks to create a similar looking scene to the actual game. that's why my games aren't carbon copies of the original, they're hand made maps with every little detail made to work perfectly with both my engine and scratch. Many other people like to borrow or make their own triangle rasterizers, but I love raycasting and it works
it's important to mention that I also use quad rasterization (with no clipping, however) in my games for all the actual 3D objects, like cars, players, breakable and moving walls, etc.
(also, responding to “system-lagging program-of-doom”, I'd like you to take a look at the amount of optimization my engines go. So no, “system-lagging program-of-doom” doesn't happen over here)
Last edited by GL00B (Dec. 3, 2025 04:41:42)
- classic_DOOMGUY320
-
Scratcher
2 posts
3D on scratch, And how it's professionally accomplished
wish i knew how to make more complex 3d stuff like that
i do know how to make the 3d projection
i do know how to make the 3d projection