This has been something that has been grinding my gears for a while, but I finally cracked some code and got it working.
Like seriously. You have no idea how happy it makes me to finally have this working. Not even a little bit. I read so many stupid web pages and tutorials on perspective projection, and not only did they all have slightly different ways of doing it, but most of them managed to give me just slightly the wrong outcome. I ended up having to combine the principles of a few of them together in order to get this to work properly.
(Side note, this project also had me sit down and figure out exactly how matrices were handled in HPL3, which led me to discover that one of the constructors for cMatrixf is bugged. Specifically speaking, the one that has 16 floats as parameters. When I use that constructor, the element at (3,0) gets the value in (0,0) and the element at (0,3) gets the value at (0,2). You know, just in case someone from FG reads this.)
(This post was last modified: 01-23-2016, 11:09 AM by Abion47.)
I know there are differences behind the scenes, obviously, but this at least visually looks a lot like a non-fixed billboard. Those are just placed somewhere in the map, and will always face the player from where they look at them from. Not sure if they can keep their original size regardless of distance from the player though (I think they shrink, due to perspective).
(01-23-2016, 06:44 PM)Mudbill Wrote: I know there are differences behind the scenes, obviously, but this at least visually looks a lot like a non-fixed billboard. Those are just placed somewhere in the map, and will always face the player from where they look at them from. Not sure if they can keep their original size regardless of distance from the player though (I think they shrink, due to perspective).
Yeah, billboards are affected by distance, so they aren't really suitable for the whole tracking thing I was going for (unless the camera is fixed, anyway).