Discuss Scratch

-RemixEdge-
Scratcher
2 posts

3D on scratch, And how it's professionally accomplished

Dude, I look up to you GL00B
MinuzOfficial-
Scratcher
9 posts

3D on scratch, And how it's professionally accomplished

GL00B wrote:

crystalchick123 wrote:

How do you code the colliding scripts if the 3D object is pen?
It may seem hard at first, but you just need to stop thinking of the objects as “on screen” sprites. Instead, our objects really are just numbers, mainly 3, the x, y and z. Since we're talking about scratch here, collisions need to be as optimized as possible, so you have to split things into 2 categories. Real, accurate collisions, which are needed for physics, player movement, or special game mechanics that need to be consistent, and the second type would be simpler, distance based collision for things like picking up objects, opening a door, or pushing a prop in the game.

The first type can use multiple different techniques, like ray intersection, bounding boxes, or (if it's a tile based engine) a simple statement to check the current tile. Based on the moving object's vector, you can stop the axis that's resulting in the collision, resulting in the wall sliding collision effect. I sadly don't have any tutorials for this, but.you can definitely look in my projects code, find the movement scripts, and check out the collision part.

The second type would just use the Pythagoras distance (or even Manhattan distance), which is the difference between the x, y, and z coordinates, all squared individually, then added up together and square rooted. ( Sqrt( Point.1² - point.2² ) ). If the distance is less than an approximate sphere (or circle in 2D calculations) that covers the model, you detect a collision.
Hi gl00b!
tictacsahur123
Scratcher
9 posts

3D on scratch, And how it's professionally accomplished

como estan
xdemon_211
Scratcher
1 post

3D on scratch, And how it's professionally accomplished

hi
WizBizarre
Scratcher
1 post

3D on scratch, And how it's professionally accomplished

I've lost many accounts, but in total I've been on scratch for over like 6 years , yet I still can't attain a certain level , your videos helped me create a small base for a game I'm making , I thank you , I hope you find a nice career for yourself in the future.

Last edited by WizBizarre (July 22, 2026 12:31:40)

Ae86bluebear
Scratcher
6 posts

3D on scratch, And how it's professionally accomplished

-RemixEdge- wrote:

DUDE!! HE'S BACK!!!!!!
Uh huh yeah lolololol
Ae86bluebear
Scratcher
6 posts

3D on scratch, And how it's professionally accomplished

xdemon_211 wrote:

hi
Hi bruh
move (WHOOOOOOOP) steps

HI IM A BIG BOI
yio64
Scratcher
1 post

3D on scratch, And how it's professionally accomplished

tottsmc
Scratcher
72 posts

3D on scratch, And how it's professionally accomplished

yio64 wrote:

Can you make a 3D project on there try to that's my challenge
Wow! How did you find this?
Mews_Dude
New Scratcher
2 posts

3D on scratch, And how it's professionally accomplished

Is there a 3D mobile game
tictacsahur123
Scratcher
9 posts

3D on scratch, And how it's professionally accomplished

de que estan ablando?
qaishp
Scratcher
8 posts

3D on scratch, And how it's professionally accomplished

Raman15 wrote:

ScodexPerson wrote:

This topic is so great that it nearly has 1K posts!
It is actually 996 posts (my post made it 997) but yeah we are just 3 posts away from this topic having 1000 posts
Good! bro!
tottsmc
Scratcher
72 posts

3D on scratch, And how it's professionally accomplished

qaishp wrote:

Raman15 wrote:

ScodexPerson wrote:

This topic is so great that it nearly has 1K posts!
It is actually 996 posts (my post made it 997) but yeah we are just 3 posts away from this topic having 1000 posts
Good! bro!
Its over 1000 now.
Mews_Dude
New Scratcher
2 posts

3D on scratch, And how it's professionally accomplished

I need a 3D mobile baldi's basics game because I love 3D mazes and I want to remix it
Cheeseboy_15
Scratcher
4 posts

3D on scratch, And how it's professionally accomplished

GL00B wrote:

kittygamer8997 wrote:

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 realism 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 poop much as possible!
vinaymb
New Scratcher
2 posts

3D on scratch, And how it's professionally accomplished

when green flag clicked 
forever
play sound [ stereo madness] until done
end
when [ space] key pressed
repeat (10)
change y by (12)
repeat (10)
change y by (-12)
end
vinaymb
New Scratcher
2 posts

3D on scratch, And how it's professionally accomplished

minecraft
AShomework
Scratcher
28 posts

3D on scratch, And how it's professionally accomplished

Hi, this is really interesting. A few years ago I attempted to make a 3D project using Griffpatch’s ray casting tutorial, although at the time I didn’t really understand how it worked, after a while I figured out that the ray casting laser was like a camera which projected the area into a 3D space, however I still don’t understand how the laser manages to generate the surroundings onto the screen, can you help me understand?
CrazyClown30
Scratcher
6 posts

3D on scratch, And how it's professionally accomplished

How do we know where the wall was that the line hit? Couldn't it have been anywhere along the line?
GL11B
Scratcher
2 posts

3D on scratch, And how it's professionally accomplished

CrazyClown30 wrote:

How do we know where the wall was that the line hit? Couldn't it have been anywhere along the line?
Well, here's the neat part. the algorithm used to determine if the ray intersects returns 2 values: A, and B. Depending on your configuration, A for instance could be the distance. This is actually all you'd need to make a simple raycaster. if you want more, then B actually returns where the ray hit on the wall itself. this means you could use it for texturing. If you want to know the exact X and Y coordinate, then it's equal to Wall(Starting point) + (Wall(End point) - Wall(Starting point)) * B. Or, you can also do Ray(Starting point) + (Ray(End point) - Ray(Starting point)) * A . both return the X and Y where the intersection happens. ( Note that A and B are floating point values between 0 and 1. )

Powered by DjangoBB