Disclaimer:
THIS HAS VERY LITTLE TO DO WITH JAVAX.SWING
None of the code here is mine, and it confuses me...


I have been trying to get back into Java (key word: trying), and have been a, well, moron for jumping back into 3D game design, one of he hardest things I could have picked. I searched around to try and jog my memory, and found this (http://www.instructables.com/id/Making-a-Basic-3D-Engine-in-Java/step4/Calculating-the-Screen/) instructable on instructables.com. On step 4, towards the end, there is some faulty code (I'm using Eclipse Luna, and it may just be for me) and am clueless on how to fix it. Basically, he/she (whoever wrote it) tried to call methods/variables that either cannot be used in the way that is suggested, or simply do not exist. I was going to comment, but the last time he/she replied to any of them was at least 2 years ago. I am not looking for a complete workaround, but maybe a method or technique that would fix the issue.

Here is the offending code (For the full code visit the link above) - NOT MINE


Code:
//calculate y coordinate on texture
for(int y=drawStart; y<drawEnd; y++) {
    int texY = (((y*2 - height + lineHeight) << 6) / lineHeight) / 2;
    int color;
    if(side==0) color = textures.get(texNum).pixels[texX + (texY * textures.get(texNum).SIZE)];
    else color = (textures.get(texNum).pixels[texX + (texY * textures.get(texNum).SIZE)]>>1) & 8355711;//Make y sides darker
    pixels[x + y*(width)] = color;
}


If you need anything else to fix the problem, please comment/message me. Thanks.

EDIT: Literally like 30 seconds after me posting this, someone asks the same question on the instructable... Dang..

EDIT #2:
Pastebin with the class:
http://pastebin.com/4eF8Ata2
So, what is the error...?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement