I decided to go ahead and begin my journey into 3D Pong. I never understood how to do it in the past, while I've always been captivated by C++ - I never had an actual reason to use it. I regret that I never actually tried before... I couldve done this four years ago - but I learnt soo much more as a programmer at least! I've been working in PHP (which I'm starting to loath.. but thats a different rant) I can say I'm fairly confident in that 'language' (if you even wanna call it that) - but as a wise one once said "bla bla bla.."
Anyhow, I tried to do too much straight away, I was going to write my own renderer interface so I can swap between OGL and DirectX with ease, but after getting deeper into it - it made less sense I would of had to write a massive interface and 2 wrappers for OGL and DX classes ! Not to mention I have no idea how to convert between Left Hand and Right Hand Coordinates (yet). Unless I misguided myself and there is an easier way of doing this? Regardless, I cut out my 'renderer' class and wrote a nice comment - DONT TRY TO DO TOO MUCH ON YOUR FIRST PROJECT.
I've never done anything like this before, so its a scary new (but very exciting) learning ground. I had no issue getting the display set up atleast, but then it came to the camera... that damn thing. I didn't understand how it worked - reading wouldn't of prepared me for it. But...
I blame my exhausted mind, I answered my own question and kept doing the same thing wrong,
"How come when I change my X position, it only rotates around 0,0,0?". I spent 20 minutes trying different x,y,z positions...
I had to end up writing the coordinates to my screen - and it finally clicked! "Change the target vector idiot!"
I finally understand how to strafe atleast! Huzzah. The endorphines were released, I'm a step closer to finally understanding 3d
I can try explain how I'm going to structure my classes atleast, any objects that exist in the game are inheriting class entity (which only really contains 3 virtual functions [setCamera, render and setup] and 1 matrix )
I'll eventually refactor my global variables to sit inside my pongGame class (which I guess you could say is the massive overlord controller)
Anything derived from Entity will be stored in an array that will be iterated each loop and rendered.
So, by my current judgement there are 4 entities. The 2 rackets, 1 ball and the world.
The world is rendered in 32x32 'tiles' (maybe its my prejudice from all the 2D programming I did back in the old day). Each tile has its own Matrix because I want to try make dramatic effects out of it - and possibly add some pinball into Pong.
With the camera, I aim to be able to give the user the ability to switch between as being the player [or rather as being a 3rd person racket], looking from the ceiling with style, or the seizure inducing ball.
Hopefully this will be a realistic goal, and my next journal entry isn't how I am sad and bitter from not getting it right.
Regardless, I will finally do this!
And when its worth it, I'll of course release the source code and hopefully a few years down the track someone generous will be happy to go through and point out the flaws and how to fix them (If only lol)
Anyhow, cheers have a good one! I will call it a night for now... big day down at the office tommorow