Builderboy2005, I wasn't in need of one myself, the snippet I gave was just to improve MatheMagician's. I took a look at your Castle Storm II obj file parser just now, and I think I prefer mine (which, before it gets lost in the comments further up is https://gist.github.com/Duta/5300560). It doesn't have material support, but only because I was showing a better route to achieve what MatheMagician was doing, and that doesn't have mat support. To be fair, it would be pretty easy to add material support to my method - if I get round to doing that, I might upload it as a standalone scenario (i.e. as more than just a comment on this one)
Glad you added the highscores, so that I can get top spot ;) Seriously though, I've always thought that this is fantastic considering all it's using is circles, a square, and lines.
Anyone care to beat me? At the moment it's this: http://imgur.com/CC4OtAe
I played some blackjack, then went in "statistics" and it's saying I haven't played any games... Bug?
Also, a back button would be nice :)
Still, good work.
In the password box, if you press Enter it adds a character to the pw box -- This is probably not what'll be wanted for most situations. Maybe just add a check in to suppress it from being entered? Hell, you could even (in the same check) add in a hook so that people who subclass it could have an "onEnterPress" action.
I don't think it'll need a whole rewrite... I opened it up and replaced CheckForVectors, CheckForWalls and readStuff with just parseObjFile. In the constructor, I replaced readStuff() with parseObjFile("Plane.obj"). Then, in draw() I made the replacement I suggested. The only thing you have to change is, in parseObjFile, change the "vertices" and "faces" to say "vectors" and "walls". And it works! :) Also, there appears to be a bug. In rotate, you do "i<vectors.size()-1" - I think this should be "i<vectors.size()" (otherwise it doesn't rotate all of the vectors).
Your code for parsing the file seems overcomplicated (and the use of substrings/indexOfs like you're doing atm makes the code hard to read). You could try something like this (I've put in a lot of comments): https://gist.github.com/Duta/5300560
I could do, MatheMagician, but this is intended to be an example of the images that can be rendered with even simple "ray" + (new Random().nextBoolean() ? "tracing" : "casting"). And, as I attempted to explain in the description, this is never intended to be real-time. My internet had gone down and so I was bored. Hence I decided to spend a couple hours making this. I'll probably improve it at some point though..
2013/4/27
OBJ file reader
2013/4/26
Speed3D
2013/4/14
Cardgames
2013/4/10
GUI Components
2013/4/5
Reflection demo
2013/4/3
OBJ file reader
2013/4/3
OBJ file reader
2013/3/12
3D Renderer
2013/3/9
3D Renderer