Discuss Scratch

TheNotableMan
Scratcher
34 posts

Raycasting 3D

Hi! I'm a 3D developer who's experienced in Almost all forms of 3D. However, one thing I struggle with is raycasting. Now, I Don't mean raycasting like griffpatch's tutorial, I can do that. What I need help with is making a full 3D world with Blocks that can be elevated off the ground and that don't have to be connected to other blocks. Does anyone have any scripts to achieve this?
TheCreatorOfUnTV
Scratcher
1000+ posts

Raycasting 3D

Why do you need this if you are experienced with 3D?
TheNotableMan
Scratcher
34 posts

Raycasting 3D

I need this because I'm experienced In a few types of 3D like Raymarching, Sprite 3D, and Raytracing (If you don't know what those are look it up) But I'm not that good at raycasting. I know a little bit, but I need a strong raycaster for the game I'm making
TheCreatorOfUnTV
Scratcher
1000+ posts

Raycasting 3D

I don't know how to have a floor and ceiling with ray casting, but I know that if the player can jump at all, you can show multiple layers (by rendering each layer, changing the Y axis every time), and therefore real-3D ray casting.
(Also, what is Sprite 3D? I've never heard of it, and I don't think it's a standard name for it, is it the 3D that uses triangles?)
TheNotableMan
Scratcher
34 posts

Raycasting 3D

Thanks for the suggestion! I'll probably be looking for more answers than this, but this is a good method. Also Sprite 3D Is making clones and changing there size.
Icefan13
Scratcher
100+ posts

Raycasting 3D

I'd suggest using rasterization for a project like that.
BigNate469
Scratcher
1000+ posts

Raycasting 3D

Basically @griffpatch's raycaster, but do it in a plane, purely mathematically, and rasterize the results.

TheCreatorOfUnTV wrote:

is it the 3D that uses triangles?)
You're probably thinking about the Painters Algorithm, which renders all triangles in a 3D scene from farthest to closest, triangle by triangle. Most programs using rasterization also use triangles, but they do not use triangle fillers, and instead figure out where all the triangles are supposed to be on the screen and render it pixel-by-pixel.
TheNotableMan
Scratcher
34 posts

Raycasting 3D

Thanks Guys! I think I'm going to use @BigNate469 ‘s Idea!

If anybody has anymore ideas, I’ll be happy to hear them.

Last edited by TheNotableMan (July 21, 2024 21:00:22)

BigNate469
Scratcher
1000+ posts

Raycasting 3D

TheNotableMan wrote:

Thanks Guys! I think I'm going to use @BigNate469 ‘s Idea!

If anybody has anymore ideas, I’ll be happy to hear them.
Just wanted to clarify on my idea- I mean have one ray per every 2 pixels or so (because speed limitations), both across the x-axis and y-axis, and don't use a sprite for the walls, just use line segments (which can be stored in something like a list) and solve some line intercept equations to get distances, and rasterize the results.

Unfortunately, due to Scratch being slow, this too will be slow.
TheNotableMan
Scratcher
34 posts

Raycasting 3D

BigNate469 wrote:

TheNotableMan wrote:

Thanks Guys! I think I'm going to use @BigNate469 ‘s Idea!

If anybody has anymore ideas, I’ll be happy to hear them.
Just wanted to clarify on my idea- I mean have one ray per every 2 pixels or so (because speed limitations), both across the x-axis and y-axis, and don't use a sprite for the walls, just use line segments (which can be stored in something like a list) and solve some line intercept equations to get distances, and rasterize the results.

Unfortunately, due to Scratch being slow, this too will be slow.

This is okay because=e they can use Turbowarp
BigNate469
Scratcher
1000+ posts

Raycasting 3D

TheNotableMan wrote:

BigNate469 wrote:

TheNotableMan wrote:

Thanks Guys! I think I'm going to use @BigNate469 ‘s Idea!

If anybody has anymore ideas, I’ll be happy to hear them.
Just wanted to clarify on my idea- I mean have one ray per every 2 pixels or so (because speed limitations), both across the x-axis and y-axis, and don't use a sprite for the walls, just use line segments (which can be stored in something like a list) and solve some line intercept equations to get distances, and rasterize the results.

Unfortunately, due to Scratch being slow, this too will be slow.

This is okay because=e they can use Turbowarp
That's what we have Turbowarp for!
MillionOfficial
Scratcher
500+ posts

Raycasting 3D

Just do the illusion by going in the background’s costume editor
TheNotableMan
Scratcher
34 posts

Raycasting 3D

MillionOfficial wrote:

Just do the illusion by going in the background’s costume editor

This doesn't allow camera movement
TheNotableMan
Scratcher
34 posts

Raycasting 3D

bump

Powered by DjangoBB