3D Game Programming - Episode 9 - Beginning 3D

preview_player
Показать описание

Welcome to a series of videos where we will create a 3D game (probably a first person shooter) from scratch, using just the included libraries in Java 1.6. If you have any questions or problems, leave a comment or send me a message, or tweet at me.

In this tutorial:
How to render 3D
How to use Bitwise Operators

Рекомендации по теме
Комментарии
Автор

From what I can tell, he basically derived the rendering mechanism from the following perspective equations,
sx = x / z tan(fov / 2)
sy = y / z tan(fov / 2)
Where sx, sy are normalized screen coords and x, y, z are 3d space coords
You can exclude the tan to get an fov of 90 degrees

Then since already know sx, sy and y(the floor/ceiling distance/height) you loop through the y coordinate of the screen and for each row solve for z:
z = 1 / sy * y
Then you have a z distance for every horizontal row of pixels
Next, for every horizontal row you loop through all the pixels based on the distance of the row from the camera,
x = sx * z

Now you have top down 2d coords x and z which you can directly translate to texture coordinates
Am i on the right track? I'm very tired

powergoober
Автор

Your tutorials are a real treasure. You did an excellent work. Thank you for sharing this so much.

Kromahtique
Автор

Anyone with issues where the colors are yellow instead of blue, or screen goes black after & 5 is added, make sure your render class's Alpha filtering is if(alpha > 0)!!! Fixed my issues and was not obvious during the scene where he flipped it back and forth, but it makes a big difference at this point in the videos!!!

EricCatlin
Автор

I give him 10/10 for the effort he put in to making the videos and I'm grateful that he made them, but at the time of making this video I don't think he had a clue how the floor method actually worked. "If you can't explain it simply, you don't understand it well enough." - Albert Einstein

thAttempt
Автор

An interesting tutorial to say the least.  It's quite clear though that you've got no idea what the code does!  How many times do you explain something as 'stuff' or just say 'so... yeah' as if that's going to clarify what is going on.

cognitiveefficiency
Автор

One thing i've noticed is that people always promise to put stuff in the description, but they ALWAYS Otherwise FANTASTIC tutorial man.

JaredJeyaretnam
Автор

I'm really torn between my opinion about these tutorials. On one hand it's quite nice to see, how games are being made. On the other hand, you are just basically typing code and then not really explaining it, but you just say what the code does (as in: "okay, here we multiply this by 2).
It is super obvious what the line does per se, but if you want to do a decent tutorial, you should explain the LOGIC behind it. And not just read the code..

So I guess i just like seeing game programming

NooB
Автор

Thnx for showing that wikipedia page! I looked at it and began to calculate how it actually works with this example. I now understand the basics, really cool (:

_wouter
Автор

lol, this is my very first 3d screen i have ever created. :D

MultiDevan
Автор

Part of the screen is black [around 1/4] and the rest is as shown in the tutorial, I have noticed others have had the same problem, Its not related to code mistakes as far as i can tell.

techbuddies
Автор

Although he doesn't go in-depth, he does say exactly why he uses each array/for/loop etc... As well, I'd recommend grabbing a basic understanding of OOP, java's syntax, do's and don'ts, and just some basic practice. I know it's annoying hearing every person say this to you, but I myself realized once I have done so, following is literally a cinch. (Like he mentioned, thenewboston(.org) or his youtube channel explains a lot! Or use other explanations of concepts etc like oracle's)

OfficialWingzzz
Автор

Thank you much, I just spent an hour and a half trying to find out what was wrong... then, I finally realized I shoudl check the comments... thankyou!

TheMpoMan
Автор

Why is this. Rated violent, I'm watching this on my iPad and there is no violence

nataliazorinliu
Автор

what i wasnt sure about was why he was doing the certain calculations (for the starburst sort of pixel formation) and without explanation i was finding it hard running through the loops. Yeah your right about the bitwise operators, that video looks useful, i used to just think about it as compare left if true compare right and so on (bit like the boolean operators). but yeah thanks for the video.

youarerank
Автор

Had to go through the floor method line by line, changing values, modifying the code and seeing exactly what was going on. Took me a couple hours and taking down notes but I think I have a small grasp of it now.

odo
Автор

To solve it, in your Render class, go down to line 26 and make sure that it is render.width and not render.height, so it should be "for (int x = 0; x < render.width; x++)" instead of "for (int x = 0; x < render.height; x++)" That fixed it for me. Hope it helps.

TheRealSqurrel
Автор

I was sort of hoping we'd start with something like a cub but maybe there's a reason we haven't. Idk :/
Everything you did in 2d made perfect sense man but I'm not so sure on this 3d.

jarrinderricks
Автор

- THE 2 RULES OF PROGRAMMING -
RULE 1: EFFICIENCY
RULE 2: CONSISTENCY
(I also suggest reading up on hexadecimal!)

bot
Автор


The code is just being copied from here, it's notch's prelude of the chambered.

DonnysRealm
Автор

I discovered that it has something to do with a mix up between the height and width variables(or something with the drawing I don't know about), as if you notice it is rendering 600 pixels in width of the floor and ceiling, the same as the height.

minecraftftwno
join shbcf.ru