How to make a 3D render system

Ain’t no way u didn’t use ChatGPT to make that post. Anyway thx, I just need a matrix to shift the 3d points to 2d. Thx for the post it’s rly detailed

1 Like

I’m going to stay on this post and do some testing.

1 Like

Didn’t Cavaire 3d try to do it? Or am I mistaken?

1 Like

Maybe he tried to do it, but I don’t think he finished it.

1 Like

He’s still working on it.

I’ve tried to make one, but I really couldn’t get the concept of size when accounting for distance away, actual size of the thing, and the orientation of the object. So I tried to make a 2D renderer instead. It’s an ongoing project. You’d have to look into that to figure out 3D rendering.

What orientation of the second degree?

epic linear algebra moment, 10 stars

1 Like

Welcome to this funny place called the forums wendover! There was a Griffpatch tutorial on Scratch about 3D rendering, and how it basically worked was that it drew lines on the screen every tick, and it used raycasting. The farther the raycast projectile went, the shorter the wall that it hit will look like. Now, I’m not sure if raycasting happening within 1 tick is possible on Gimkit, but this helps, I guess.

would now be a good time to mention i made a 3d wireframe system a while ago (january or so), although I never got rotation working on it?

also that was my old secret project, I’ve found a new cooler one so i’m revealing this now lol

2 Likes

Anyway, the method I used was pretty simple.

I wrote some code for converting 3D points into 2D with the following equation:
(X, Y) = (X * 200/Z, Y * 200/Z)

Then, I implemented bresenham’s line drawing algorithm, to take two points and draw a line on a display between them.

Finally, I wrote code to take an X, Y, Z, and Side Length value set and turn it into the points of each corner of the cube, centered at the origin. I translated the cube to where it was supposed to be, then I turned each 3D point into a 2D point, and plugged pairs of points into bresenhams line drawing algorithm to render the cube.

The cube was moveable on the X, Y, and Z axis, by simply changing the coordinates plugged into the whole system and re-rendering.

The equations for rotating the 3D points I never quite figured out, trig is my weak point :(. But if you were to implement them, you would rotate the points before translating them to their xyz position in the world.

So uh yeah. 3D. That’s how. I have no clue what you all were going on about with linear algebra and whatnot.

4 Likes

coordinates are represented as vectors and to move these coordinates, you’d have to apply a linear transformation on them which is practically what you did without stating they were vectors

dang. thats pretty amazing, ngl. i’m honestly impressed that you managed to create a full 3d wireframe system just by yourself, that’s actually rly cool! and it’s fine that u still haven’t figured out the equations for rotating the 3d points; im sure u’ll figure it out eventually! and it’s great that u were able to find a new and more interesting secret project to focus on:)

I mean, this is a bunch of stuff of 3D builds, maybe this can help.

No they can’t. That’s a completely different thing.

4 Likes