Sunday, May 13, 2012

jPCT-AE for the gold

My previous hope of getting jMonkey to work was a bust. The engine had it's own IDE which was bulky and lacked the Javadoc that Eclipse has. When I tried to use the library in Eclipse, the IDE crashed while trying to compile all of the stuff :-/. So, I just trashed the whole jMonkey thing.

After re-looking at the engine site, I found a few engines which I could use. Rajawali, Libgdx, and jPCT-AE. Briefly checked out each one (to make sure it had a stock of documentation of how to use the engine). Then I tried jPCT-AE first....it works pretty well.

Loading the obj file and applying a texture to it was a lot (3x more) easier than using raw OpenGL code. The engine even comes with addChild/ addParent functions. I won't have a use for the addParent function yet, but the addChild one...it's gonna be thoroughly abused if I'm gonna get this game working.

I had a problem the last 2 days, attaching blocks to the spool face. Translate the block to the spool's outside, then rotate it around the spool. Sounds simple, only need to use ~7 lines....not so easy. It would rotate the object THEN translate it. A few mins ago, I found something in the Javadoc which I somehow missed.
"The translation will be applied the next time the object is rendered", which explains my problem. So I switched to using the rotation/ translation matrices (the jPCT-AE built in ones). And it worked.



It looks like I'll make the goals for this week....but I'm a little worried if I'd have a playable demo for week 4 :-/...well, no sense in worrying when coding gives more results :-).

= Todo = (for this week, in this order)
- add transparencies to each block (the spool is using global transparency, not texture transparency)
- lighting for each spool
- rotate the spool using touch (adjust lighting after each competed block rotation)
- complete the reel class (it generates x number of spools on command)
-  change selection (left/ right) by using touch and adjust lighting after a spool change
- add text to the screen (shouldn't be too hard, the demo already has code which does it)
-+ refind the program which converts fonts to bitmaps
- make a menu with the font (hopefully get some transparency on the fonts?)
- move the menu items while the spool is rotating

It's a little bigger than the todo list I made with the teacher, but these are more detailed steps of what I'm gonna be doing...I still don't even have block images for the menu items. Oh well, I'll send those tasks to Chris later this week. I already have the concept of what they will look like (written down), they just need to be drawn out.


 

1 comment:

  1. Well, not quite in order as I was hoping for, but I finished a few items on the list. The blocks now have transparency, the spools rotate on touch (swipe to be specific, fling is not yet added), and the reel class is finished.

    Lights will still need a bit of playing around with to make it look good...but I guess it wouldn't hurt to put that to the end of the todo list.

    Now, I'm working on switching between spools and enabling finger action for only the selected spool. Currently it's only for the first spool.

    ReplyDelete