Discuss Scratch

SirPootis
Scratcher
25 posts

3D Engine suggestions?

Hello,

I'm trying to make a 3D math rendered project and I need a 3D engine. I've tried 1 already but there were a few problems I found that I wasn't sure how to fix. I'm looking for one that has a lot of control and its easy enough to understand. If it doesn't have some kind of custom “Go to x,y,z” block I don't care for it. I'm not as advanced in math so I can create a 3D engine from scratch.

Thanks
PintOfMilk
Scratcher
1000+ posts

3D Engine suggestions?

SirPootis wrote:

Hello,

I'm trying to make a 3D math rendered project and I need a 3D engine. I've tried 1 already but there were a few problems I found that I wasn't sure how to fix. I'm looking for one that has a lot of control and its easy enough to understand. If it doesn't have some kind of custom “Go to x,y,z” block I don't care for it. I'm not as advanced in math so I can create a 3D engine from scratch.

Thanks
@MathMathMath


Does n!+1=m^2 have interger solutions apart from n=4,5,7?
SirPootis
Scratcher
25 posts

3D Engine suggestions?

That actually is the first 3D engine I tried but it didn't have a “Go to x,y,z block” I could probably create it using that but I'm not sure how.
badatprogrammingibe
Scratcher
500+ posts

3D Engine suggestions?

OpenGL
ScratchMan544
Scratcher
100+ posts

3D Engine suggestions?

badatprogrammingibe wrote:

OpenGL
I believe OP is referring to a Scratch project. Though a port of OpenGL to Scratch would be interesting as well : )

Oftentimes, you don't need a full 3-D engine for a project. For example, in my project DTR-GTG Remastered, the player's jump animation looks like it is going “towards” the camera, but it's actually very simple—there's no trigonometry or angle manipulation involved at all! There are
(z)
(coordinate) and
(zv)
(velocity) variables alongside the x and y, and I use some coordinate tricks to get the desired effect: there's a shadow sprite which keeps track of the “real” coordinates of the player, and then the visible “player” blue dot's x and y coordinates are some multiple of the shadow's coordinates, where that multiple depends on
(z)
. When
<(z) = [0]>
(the player is on the ground), this multiple should be one, and as
(z)
gets bigger this multiple should as well. In that project, I calculate it as
((1) + ((z) / (40)))
. This multiplier also affects the player's size as well, so that when the player is closer to the camera it looks bigger.

You can see the code for yourself in the “player” and “shadow/control” sprites.

I used a similar technique in my unfinished Space Shooter 3D game, but in this case, the bullets' multiplier is smaller than 1, because they are going away from the camera.

Last edited by ScratchMan544 (Feb. 23, 2018 22:07:56)


_=(lambda _:lambda __:_(__))(lambda _:getattr(_,(
    lambda _:_[:2]+str(print.__call__)[0b10011:(1+1<<1+1+1)+(1<<1+1)+(1<<1)+1]+_[-2:]
)(__name__)))(eval)
(lambda _:lambda __:_(__))(lambda _:_(_(
    __import__(dir(__builtins__)[((1<<1+1)<<1+1+1)+(1+1<<1+1+1)+(1+1<<1)+(1<<1)][:3].lower()),
    print.__doc__[46:52]),open(__file__).write.__str__()[17:22]))(_("getattr"))((
    lambda _:lambda __:_(_,__))(lambda _,__:""if __==0else chr(__%128)+_(_,__//128))(963149002634454890336513358634316810781103160855182366005237514)[::-1]
)
TheMonsterOfTheDeep
Scratcher
1000+ posts

3D Engine suggestions?

Are you looking for orthographic or perspective projection?

If you're looking for orthographic projection, the code is really straightforward. It's slightly more complicated for perspective projection, but mostly just conceptually–the implementation itself is not much worse.

Note that there is no trigonometry involved in the actual calculations. It's all multiplications and additions, and maybe divisions (my memory has sort of faded now that I'm mostly using OpenGL for 3D stuff).

If you want to do 3D stuff in the most straightforward manner, I would recommend reading up on transformation matrices (which will allow you to trivially translate/rotate/scale your models/camera).

Last edited by TheMonsterOfTheDeep (Feb. 24, 2018 06:58:19)


my latest extension: 2d vector math
PintOfMilk
Scratcher
1000+ posts

3D Engine suggestions?

SirPootis wrote:

That actually is the first 3D engine I tried but it didn't have a “Go to x,y,z block” I could probably create it using that but I'm not sure how.
I tell you what I'm making an engine at the moment and I'll add a go -to XYZ block!


Does n!+1=m^2 have interger solutions apart from n=4,5,7?

Powered by DjangoBB