Tuesday, May 15, 2012

Spool placement problems

Well, I fixed the weird problem of all the objects merging onto each other (sadly I don't have a picture of it). The problem was caused by z-fighting, and I wouldn't have been able to figure out the problem unless there was scaring on the colors. So, I manually set the z-buffer on the objects (programmly of course) and the image looks a lot better with more spools on the screen.

I still haven't gotten the per-block lighting worked out. I'm trying to do a back-lit object like portal uses for their level screens (http://www.instructables.com/image/FIE8HZKGWTIJT0J/Portal-Level-Sign-Wall-HangingLamp.jpg), but instead, the blocks avoid using the light :-/, while the spool hubs are flooded with the light. Currently, this is not at the top of my priority (weird of why I set it so high on my previous list).

What is my current priority is the reel class. Yes, I said it was finished...but that doesn't mean its bug free. The structure and and the assumed actions are completed. After getting that z-glitched figured out (and enabled actual testing of the reel class), I got a new.....problem. lol. I am unsure of how it happened. It works half-ish both ways....I'll just post the pictures then explain.


When the game starts, the spools look like this (damn lighting, lights the wrong objects). The rightmost spool (spool 0) is in its correct spot, spool 1 is also in its correct spot, its blocks however are not.

 After touching the screen to rotate the spool (works correctly by the way, spins both blocks and spool hub on spool 1), the objects of spool 1 all shift rightward.

The reason I say "I am unsure of how it happened.", is because the spin code doesn't do anything to the spool's translation.

= spool class =
    public void Spin(float val)
    {
        Hub.reset();// resets rotation only
        Hub.rotateZ(30 * totalRot);
        Hub.rotateZ(val);
        Hub.rotateY(110);
    } 

Looks like I got another interesting problem ahead of me. Luckily, I can easily apply all of this knowledge to the gameplay part of the game (whenever I get to that point).

No comments:

Post a Comment