Microsoft MakeCode

My 3D Rendering Code

UPDATE

not latest version!

3 Likes

UHVIUEWFLIUEWFLBIUHLIEF HOW DO PEOPLE DO THIS???

I’m honestly too scared to look at the code. How does this work?

2 Likes

It says in the description.

It’s broken though.
And I don’t know why yet.

1 Like

It works fine for me, except if you go too far it doesn’t render or I just didn’t turn enough.

Yeah I have exactly no idea what that means but I’ll take your word! I’ve heard of matrix rotation though somewhere…it’s a pain to do in Python at least without Numpy.

1 Like

It’s just a bunch of sin cos -sin and atan2

1 Like

The bugs are when you get inside / really close or go down far then look up

1 Like

I think I might try to do the game jam thing. I wonder If I could make a 3d ocean?
That would be epic

Ah, Fixxed It @UnsignedArduino

Thinking about making a minecraft type clone.
wasd ijkl and space

6 Likes

How- like how do you people do this?? This is hecking amazing!!

3 Likes

Well, have you done matrix multiplication? Because it uses that.

  1. Rotate each point to be in front of the camera
  2. Squish them all into a straight line (AKA a small cube)
  3. Draw them based on the Z coordinate!

You can check the code if you’re interested.

4 Likes

UPDATE
made resolution low for now to reduce lag

uses mesh to draw sides of cubes

3 Likes

UPDATE
fixed resolution and completely scrapped and redid code for meshes (fast!)

3 Likes

Okay but- is this possible in blocks?? I doubt it but it’s worth asking

1 Like

Well Theoretically yes, but It would be way more confusing.

1 Like

I don’t believe you can have classes in blacks so It’d be very disorganised. (Like blocks normally look to me atleast!). If you don’t know what classes are I’d be happy to explain.

2 Likes

Please do explain

1 Like

A class is like a object you make yourself:
Image is a class
Sprite is a class
If you want to create a new class you could use it for:
Storing a position eg.
stores an x and a y value
can be rotated
can tell distances

I will make a quick project

2 Likes

ohhh!!

2 Likes


Bad example but you get the point

2 Likes

I wonder if someone could work out what code I put on my profile pic… :slight_smile: it’s a bit blurry.

Python 3? I saw the functions range and len at the very top. And there are colons everywhere; definitely Python syntax!

1 Like