[solved] Need help on my 3D engine

ugh, nothing’s gone right ever since the second half of the tutorial, i really need help

i’m on after the part where he explains about “point-to” matrices on the slides (which i call cframes (short for coordinate frame) because roblox uses the exact same rotation system and that’s what they call it (and i think it’s a much better name)) here is the video

(also i just realized to understand what my code does you would have to watch the previous video of the tutorial given you don’t know much about 3D… well it’s only about 30 mins long, and so is the part before i got stumped, so you would have to watch one hour of the tutorial…)

pk3d.wick (8.8 KB)


(the real utah teapot had too many polygons my game would run at 1 fps)

i’ve got the world projected the way it should be when you start. i also have the code with the cframes david showed in the tutorial (although the projection code for this is commented out). there’s a cframe class (because i thought the way david did it was a bit weird (mostly because i’m familiar with how they work in roblox and i thought the way that was handled made more sense)). but the class is unused currently because i spent like 2 hours trying to debug the code to no avail, so i tried do everything the way the tutorial showed instead of my way.

i also disabled the crappy clipping solution for now. this is because with it disabled you can see the scene behind you, and i disabled this in case the camera was working but it was actually facing behind the scene. it’s tinted red so you can differentiate from real geometry.

so if anyone has the expertise and time to do so, i would really like it if you helped. (hopefully my code is readable enough)

Maybe I’ll ping some experienced coders I know @nvm idk that seems kinda
Umm maybe i will @awc95014 @Jovanny @Hamzah_Alani (i think i’m forgetting someone else) do you think you could help?

I think yours look great!

this is definitely not my department, my code is not very good, i suck at OOP, and it’s so low-tech it’s insane.

somehow i got through it with my platformer engine while having some amount of good quality. to be honest, my platformer engine isn’t “popular” because it’s exceptionally good or something, it was just the first one of its kind to work well.

but things up to this scale, i instantly crumble. the most i can do for these things is… test out.

oh, i thought that the tutorial would help it kinda make sense… the tutorial explains all 3D concepts and i think some background information you would need to know is how trigonometric functions work, and vaguely how matrices work (you don’t need to worry about how matrix mulitplication works, besides you can search it up like i did, the Maths Is Fun site has a good article explaining how it works. and i’m presuming it’s spelled “maths” in the title because whoever made it lives in the UK)… i think that might be too much to know. i literally only know them because i was forced to learn it by googling it all up.

do you not understand it or do you suck at using it? unfortunately i can’t remember any experiences of me sucking with object-oriented programming

I use basic javascript, sorry!

mostly that I’m bad with using it and i don’t know where to start with it. i did OOP with python, but that was with my mom helping me like the whole way. and it was multiple files and yada yada yada I’m just making excuses at this point.

pumpkin I understand the fascination of the challenge but honestly I dont think wick is, at present, the right tool to make 3d

Three things:

  1. What you have done is amazing, and I understand how it works
  2. I have school, so I’ll need some time before starting to watch the tutorials
  3. Even if I watch everything, my tiny brain might not be able to understand how you did this

I recommend taking notes down while watching the tutorials (which is what I’ll do).
I’ll reply back once I’m done with watching the videos (I’m more likely to be no help at all).
If I can’t find anything to help, then I’ll just share my notes (which might help).

1 Like

i put my problem in the youtube comments hoping to get some help, and good thing david reads comments from 2-year old videos

here is what i currently have: pk3d.wick (8.8 KB)

1 Like

yeah i know wick isn’t the best for 3d, i don’t think texturing would be possible at all, but this for like an experiment, and it can show how great wick editor can be

1 Like

Guys, I finally found out what the problem was. The problem was that my camera’s up vector (the direction the top of the camera is) was always set to be pointing up relative to the world, rather than the camera. So when pointing the camera up, it would point in the same direction was the camera’s up vector which is invalid. This is because the up vector is supposed to always be pointing away from the top of the camera. Here is an illustration that hopefully explains it more concisely.


oh yeah and i forgot to mention i swapped some rows of the transformation matrix so having a forward vector of (0, 0, 1) and an up vector of (0, 1, 0) would make an identity matrix. i need it this way, because an identity matrix is kinda like the number 1 in multiplication, a * b = a where b is the identity matrix. i think that’s how it works

oh and here’s the file with the fix:
pk3d.wick (8.9 KB) arrow keys to look around, , and . to roll around, it works. the camera doesn’t move relative to itself, unlike in the previous working version (with the transparent faces)
wait rolling’s a bit weird maybe it has something to do with the rotation ordering

here’s the other side of the teapot lol
image

(everytime i ask for help i always end up solving it myself this is why i try not to ask for help)

thanks @Hamzah_Alani for trying to help

3 Likes

Wow. No words… well yeah, some words… I think that this is fantastic. Well done, it looks like a blender 3d low poly render.

2 Likes

great result pumpkinhead
you did not let me discourage you and you obtained an excellent outcome :+1: :+1: :+1:

yup. texturing would be difficult
I wonder if it could be possible to use part of your code to implement a warp tool to distort bitmaps like that of animate or dragon bones

have a look at this article on how to create image on the fly in canvas


I need some free time to dig into it

Well yeah but this is for Wick Editor, I kinda don’t want to use hacks to access the canvas context of wick editor… I mean I dunno. The only hacks I used for my 3D engine is accessing path point data so I can distort the shape of the triangles. But manipulating the canvas directly is something I don’t want to do since it could conflict with other Wick Editor stuff.

I see but as far as I know this is the only way to modify bitmaps at present