Direct X Squares and Lighting
Okay So, I actually did this more then a week ago. But decided to include it since well I spent a few hours working out lighting and Squares in 3d space. I was surprised how much trial and error was involved. While this demo video below isn’t perfect since I actually have to figure how much light is needed to bounce off of every side of the square. I ended up understanding but tried for another effect. In the video you’ll see two squares rotating. They have an ambient light lighting them constantly so we can see them, but I included a spot light….
The interesting thing about the spot light is that in direct x, you don’t just say “I want my spot light (X,Y,Z) and facing a certain way”. You actually have to indicate which vectors triangles are going to be lit. That means if I was to set random vectors to be lit, I could get a sort of random effect of light fading in and out of certain sides. While this is nothing really special it give a strange lighting effect. that I somewhat enjoy. Anyways, Why I haven’t been doing much with direct x for the last week as I stated above, was because I have been working on more of my coding intermediate “basics”. This I am hoping will help me understand more later on down the road. Once I finish this book, I should be back to focusing more on graphical programming, as I need an engine to run my games…
Anyways here is the video.
One other thing is I forgot to deselect the option to record what you are listening to, As I was listening to some music it was recorded as well. It is also quite loud before starting the video turn your speakers down.
If you did like it… The guy is called DNTEL. Very good music to listen to.