Help! I’m making a 3D game but I need someone to help me with the movement

help_me_please
3d
codeproblems
r834_was_here
#41

@ThinBuffalo do you know if tangent is useful for 3D rotating?

1 Like
#42

Probably.
It seems like it to me.

1 Like
#43

Ok now let’s wait… :sleeping:

#44

It’s far too in depth of a topic to try and repeat all the necessary explanations here, so I’ll point you to a couple external resources

https://en.m.wikipedia.org/wiki/3D_projection (see perspective projection, part way down)

https://www.scratchapixel.com

3 Likes
#45

Lol

#46

Ok COAN just made a 3D engine but I don’t understand the code… I was studying it myself but it has lots of variables that I don’t know where they come from…

2 Likes
split this topic #51
#53

@Awesome_Coder_25
Have you seen my new game? Is a basic (doesn’t work to well though) 3D code, may u check it plz?

2 Likes
closed #62
opened #63

This topic was automatically opened after 29 minutes.

#64

so was that when you asked n your 3D game you needed to fix the weird glitch and stuff like that?

1 Like
#65

Yes! It was here!

1 Like
#66

@CodeHelp @TheDeliciousOrange @ThinBuffalo @CreationsOfaNoob someone may help me with the bring to front/send to back stuff? Here’s the game:

7 Likes
#67

I thought i did that 4 u…

1 Like
#68

That looks awesome!
Layering the objects is currently not possible to do smoothly, but there’s a few ways you could get the effect.

One way is to calculate the distance to the camera (or just use the transformed Z coordinate, dz) and in a 7=7 block:
wait (distance to camera)
bring to front.

That could cover the UI though, so you could do it the other way and send to back instead:
When 7=7
wait (render distance - distance to camera)
send to back

THT has said that a direct ‘set layer’ block is on their roadmap though. When that comes, 3D projects are going to look better.

6 Likes
#69

Yeah I know but the code bugged a lot…

1 Like
#70

Yeah I used the first method you said and then the objects started to “blink” idk if I’m explaining myself, but I’ll try the second method… THANK YOU A LOT!

2 Likes
#71

The blinking is when the objects far away bring to front and get displayed above the closer objects. That’s an artifact that’s hard to work around, and we can’t get it perfect without a set layer block.

2 Likes
#72

Hey I got an idea… when the z layers come, the code would just be, when 7=7
Set layer (self) z distance to camera

1 Like
#73

Yep.

1 Like