Discuss Scratch

ZeldaFan1987
Scratcher
30 posts

3D Checkerboard Floor Using Pen?

Alright, so I'm trying to make something similar to this. I've used it in several projects, and it works fine, but I have several gripes with it. For one, there are too many confusing numbers for my primitive coding mind and it's difficult to adjust factors like the horizon line's Y position. Second, I want a more customizable color engine for the floor tiles than using one color and then using a seemingly different degree of brightness than what I asked for and the darker tile not being the desired color. Essentially, I want a more customizable script that can be easily edited, is open source, and looks sort of like Mode-7. Last; I don't know if this can be fixed, but it also has some lag. Can someone try to help me? If your code works, I promise to give you credit in the project(s) that use it.

Last edited by ZeldaFan1987 (March 23, 2025 20:39:53)

Myskit
Scratcher
20 posts

3D Checkerboard Floor Using Pen?

The way I've been doing 3D would allow for this naturally.

First: You need a 3D Rendering engine. This means you need code to take each point in 3D Space and transfer it to a 2D Space. This is done through a Projection Matrix. Projection Matracies can be confusing, so just know you need to take each point and use the Z to scale it. That's usually done by dividing X and Y by Z respectivly. Than, for more complicated projects (or really anything 3D) You need a Rotation Matrix, which uses Trig functions to calculate it's position again based on rotation properties.

Once you have the actual engine one, the best way to do it is store all your points in lists. It's fairly labor intensive, however it's easier than say loading OBJ files.

Than, just figure out how you want to do your color. Just use the points to determine that.

when it comes to filling in 3D shapes, I have no clue how, but that is what you want.

As for many different colors, you could store all the values for colors (Color, Brightness, Saturation) in a list and call those.

The lag is imperative, because Scratch is slow, especially with the pen, however using Turbowarp or other alike mods do improve Preformance drastically.
ZeldaFan1987
Scratcher
30 posts

3D Checkerboard Floor Using Pen?

Myskit wrote:

The way I've been doing 3D would allow for this naturally.

First: You need a 3D Rendering engine. This means you need code to take each point in 3D Space and transfer it to a 2D Space. This is done through a Projection Matrix. Projection Matracies can be confusing, so just know you need to take each point and use the Z to scale it. That's usually done by dividing X and Y by Z respectivly. Than, for more complicated projects (or really anything 3D) You need a Rotation Matrix, which uses Trig functions to calculate it's position again based on rotation properties.

Once you have the actual engine one, the best way to do it is store all your points in lists. It's fairly labor intensive, however it's easier than say loading OBJ files.

Than, just figure out how you want to do your color. Just use the points to determine that.

when it comes to filling in 3D shapes, I have no clue how, but that is what you want.

As for many different colors, you could store all the values for colors (Color, Brightness, Saturation) in a list and call those.

The lag is imperative, because Scratch is slow, especially with the pen, however using Turbowarp or other alike mods do improve Preformance drastically.
I don't know any fitting renderers for a project using my concept. I have blender, but I would have to reduce the colors by hand and use a program to crop and scale down the render. Note that I also do not know how to add textures or colors to models in Blender. Seems like there's a better way to do it. Can you recommend renderers? Pretty sure PicoCAD has too low of a resolution.

Last edited by ZeldaFan1987 (March 25, 2025 20:53:16)

Powered by DjangoBB