Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  LWJGL - Rendering A Texture Onto A VBO >>($10 REWARD)<<  (Read 3202 times)
0 Members and 1 Guest are viewing this topic.
Offline Genius Coder

Junior Devvie


Medals: 1
Exp: 4 years



« Reply #30 - Posted 2014-06-10 08:10:49 »

Yes I have done that, here is the latest source code:
https://www.dropbox.com/s/5r2fcdhsgf2gpcm/VRAID%20WITH%20VBOs%20AND%20TEXT%203.rar

I love making games...
Offline NegativeZero

JGO Knight


Medals: 34
Projects: 2
Exp: 3 years


Zero but not.


« Reply #31 - Posted 2014-06-10 08:15:40 »

The main reason people aren't helping you is that you keep giving us your code via dropbox and not via pastebin like people keep saying.
Short of pastebin, you could use Github or something of the like.

But tbh I don't think JGO is the place to be giving out money as a reward, generally if people have the abilities to help you (and you're not making it too hard for them), they will help you.
Offline Genius Coder

Junior Devvie


Medals: 1
Exp: 4 years



« Reply #32 - Posted 2014-06-10 08:23:15 »

Well I thought putting the project up would be easier and from what I remember no one has said use pastebin, but I shall if it helps. Thanks! Grin

Pastebin Links:
-----------------------------------------------------------------------------------------------------------
MAIN GAME:
http://pastebin.java-gaming.org/7fd9d8a529f

DISPLAY MANAGER:
http://pastebin.java-gaming.org/d9da20f6b99

FACE:
http://www.java-gaming.org/?action=pastebin&id=961

MODEL:
http://www.java-gaming.org/?action=pastebin&id=962

OBJLOADER:
http://www.java-gaming.org/?action=pastebin&id=963


I love making games...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Rayvolution

« JGO Spiffy Duke »


Medals: 219
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #33 - Posted 2014-06-11 08:04:01 »

*Bump*

There's almost literally no reason to ever bump a post here on JGO, pretty much all the regulars read everything.. not to mention it's a fairly small community (at least, active poster wise), it's not like you're going to bump off the first page in 24 hours.

- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Offline Genius Coder

Junior Devvie


Medals: 1
Exp: 4 years



« Reply #34 - Posted 2014-06-11 08:11:08 »

Ahh, now heres a man I know well. Hows your game coming on? Do you still livestream? and do you know what my projects problem is?
 Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy

I love making games...
Offline Genius Coder

Junior Devvie


Medals: 1
Exp: 4 years



« Reply #35 - Posted 2014-06-11 14:40:15 »

and yeah sorry for the bump, my bad. I dont usually do it im just a little stressed because I really cant figure it out...
 Cool

I love making games...
Offline PandaMoniumHUN

JGO Coder


Medals: 32
Exp: 3 years


White-bearded OGL wizard


« Reply #36 - Posted 2014-06-11 15:13:08 »

and yeah sorry for the bump, my bad. I dont usually do it im just a little stressed because I really cant figure it out...
 Cool
I've just had a really quick look into your source code and one minor issue that I've spotted is that when you're loading OBJ files you should negate 1 from the indices (because OBJ starts indexing at 1, while Java and most of the programming languages start indexing arrays and lists at 0). So essentially you should change your OBJ loader's last lines to something like:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
} else if (line.startsWith("f ")) {
                Vector3f vertexIndices = new Vector3f(Float.valueOf(line.split(" ")[1].split("/")[0]-1),
                        Float.valueOf(line.split(" ")[2].split("/")[0]-1),
                        Float.valueOf(line.split(" ")[3].split("/")[0]-1));
                Vector3f uvIndices = new Vector3f(Float.valueOf(line.split(" ")[1].split("/")[1]-1),
                        Float.valueOf(line.split(" ")[2].split("/")[1]-1),
                        Float.valueOf(line.split(" ")[3].split("/")[1])-1);
                Vector3f normalIndices = new Vector3f(Float.valueOf(line.split(" ")[1].split("/")[2]-1),
                        Float.valueOf(line.split(" ")[2].split("/")[2]-1),
                        Float.valueOf(line.split(" ")[3].split("/")[2])-1);
                m.faces.add(new Face(vertexIndices, uvIndices, normalIndices));
            }


Edit: Do not mind the code snippet above. I've just noticed that you negate 1 from your indices in your game's setupVBOs() method. By the way, no offense but your code is bit uhm.. Ugly. Cheesy

Also some general tips that can help: Always make sure that you're checking for OpenGL errors with glGetError(), and don't enable face culling until you've got everything working. Once that's done enable culling and if you get weird results make sure that your winding order is correct, or change the default winding order from CCW to CW.

Finally, it would might help to take a look at my extremely small 3D engine's graphics package (it isn't even capable of using textures on models, just vertices, normals and a single light source), it uses modern OpenGL (3.1+) but it shouldn't be an issue for you to port it to older OpenGL. Smiley

Edit2: Downloaded your eclipse project, now I'm trying to make sense of things. Hopefully I will be able to soon spot the mistake.

My Blog | Jumpbutton Studio - INOP Programmer
Can't stress enough: Don't start game development until you haven't got the basics of programming down! Pointing
Offline Genius Coder

Junior Devvie


Medals: 1
Exp: 4 years



« Reply #37 - Posted 2014-06-11 15:56:35 »

Cheers buddy  Cheesy and yeah I know the codes ugly and probably extremely unoptimised but I'll get round to sorting it once the errors fixes, I like your effort and attitude to contribution here. Good job buddy!  Grin and I hope you can help fix it!  Cheesy

I love making games...
Offline Genius Coder

Junior Devvie


Medals: 1
Exp: 4 years



« Reply #38 - Posted 2014-06-11 22:43:06 »

I have been speaking with a fellow member of the community whom i believe speaks for many in that i have acted inappropriately. I apologise if i came across aggressive, or if i offended anyone with my language. I also apologise for the large amounts of unnessacary code.

All in all, i apologise!

I love making games...
Offline saucymeatman
« Reply #39 - Posted 2014-06-11 23:44:30 »

Giving you a solution to your current problem would be doing you a disservice.

The problem described in the original post is a side effect of the way in which you program, try to consider how you got in a situation where you are unable to find (Let alone fix) a bug that could be in any part of 5 different files.

If you keep working like you are now, you'll keep running into problems like this.

I recommend that you carefully document your code as you are writing it and take great care in writing programs that are modular so you can point at the exact subroutine that is causing you problems and fix or replace it.

Take time to consider your program's design, in a perfect world you could test each component of your program individually and determine if it is stable.
In the real world, components depend on each other, but we can at least try to determine a component is stable before allowing new components to depend on it.

I hope you can tell I'm trying to help and not trying to be condescending : )
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Genius Coder

Junior Devvie


Medals: 1
Exp: 4 years



« Reply #40 - Posted 2014-06-12 10:00:26 »

I understand and I thankyou for your honesty Smiley

I love making games...
Offline PandaMoniumHUN

JGO Coder


Medals: 32
Exp: 3 years


White-bearded OGL wizard


« Reply #41 - Posted 2014-06-12 11:29:34 »

So I've had a quick peek at your source code, now in Eclipse and what I have to say is that I agree with saucymeatman.
You should be thinking more about your programs design and categorize your methods and routines into appropriate classes.

If I were you I would rewrite the entire thing from scratch again. I know it sounds horrible, but sometimes small mistakes get into our programs and it feels impossible to find them (this is where good program design comes to play - if you have a good design you can usually spot the error way faster than with a bad design, so instead of making a habit of rewriting things pick up the habit of maintaining good program design Smiley ). Most of the oldschool programmers don't really like this advice, they like to go after their bugs trying to find it, no matter how long does it take, and you know what, I kind of agree with them. However, for extremely small projects like this sometimes it's just faster to rewrite the entire thing than to be on the hunt for a single wrong OpenGL parameter or something for days. Pointing

Some additional thoughts:
Honestly I think that you should remove the money reward, most of the community here helps out people because they love to help, not because they expect something in return.
If somebody else would solve it for you it wouldn't really help anyway, seeing that you haven't really got down the basics yet. I would rather suggest you to pick up a book (OpenGL Superbible's 6th edition is great) and learn from there, one small step at a time.

Also you could make your own job easier by utilizing the tools that modern OpenGL (3.1+) provides you, for example Vertex Array Objects.
Instead of using all those glVertexPointer(), glColorPointer(), glNormalPointer(), enabling and disabling client states you could just spare yourself the time and use VAOs, so you set up all those things once with vertex attribute pointers and then use it wherever you want to with a single call (glBindVertexArray(vao)). Also in modern OpenGL you have to provide the matrices yourself, write your own shaders, but all these things allow for great flexibility and customizability. However, switching from legacy OGL to modern OGL is not easy, you will have to learn quite a bit of new stuff so I wouldn't suggest you to make this project of yours already OGL 3.1+, but to make your next project learning modern OpenGL. Trust me, it's worth your while and you'll have to learn it anyways if you want to make anything serious. Cheesy

My Blog | Jumpbutton Studio - INOP Programmer
Can't stress enough: Don't start game development until you haven't got the basics of programming down! Pointing
Offline Genius Coder

Junior Devvie


Medals: 1
Exp: 4 years



« Reply #42 - Posted 2014-06-12 14:39:22 »

Chears man once again for the great advice. I shall try rewrite the whole thing if it means I fix the bug and I guess the commands will stay implanted into my head for future use  Grin About that book; Where can I find it and do you have a link for me. Ive been meaning to but an OpenGL book but sort of put off by some of the bad reviews with some of the books

I love making games...
Offline Genius Coder

Junior Devvie


Medals: 1
Exp: 4 years



« Reply #43 - Posted 2014-06-12 14:41:08 »

Does anyone know why I have been blocked?

I love making games...
Offline bogieman987
« Reply #44 - Posted 2014-06-12 14:57:47 »

OpenGL Super Bible 6th Edition is available on Amazon, and probably many other sites that sell books.
Here are some ISBN (International Standard Book Number) codes: ISBN-10: 0321902947 ISBN-13: 978-0321902948
Copying one of the codes into what ever Amazon site you use should bring up the book.
Putting it into Google brings up lots of other sites that have the book.

I agree with PandaMonium, the book is great Cheesy

Even though the example code in the book isn't written for Java, it's not too difficult to translate it.

And by "blocked" do you mean "In the Padded Room"? No idea. Perhaps you haven't sacrificed enough lambs this week. jk

Offline Genius Coder

Junior Devvie


Medals: 1
Exp: 4 years



« Reply #45 - Posted 2014-06-12 15:18:03 »

Yeah I have killed more than usual this weak...

I love making games...
Offline SHC
« Reply #46 - Posted 2014-06-12 15:24:51 »

Does anyone know why I have been blocked?

Not sure, but maybe because of your bumps.

Offline saucymeatman
« Reply #47 - Posted 2014-06-12 17:07:55 »

He hasnt 'bumped' the thread in a while as far as I can tell, weird. Im sure an adminstrator will send you a private message explaining why, check your inbox.
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 835
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #48 - Posted 2014-06-12 17:14:32 »

http://www.java-gaming.org/topics/re-lwjgl-rendering-a-texture-onto-a-vbo-5-reward/33491/view.html

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Genius Coder

Junior Devvie


Medals: 1
Exp: 4 years



« Reply #49 - Posted 2014-06-12 18:10:52 »

I'm almost 100 percent sure I did not bump 5 times honestly and I apologise for doing the ones did anyway

I love making games...
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 835
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #50 - Posted 2014-06-12 18:13:35 »

I'm almost 100 percent sure I did not bump 5 times honestly and I apologise for doing the ones did anyway
You made 5 bumps in 1 topic in 6 days.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Online Gibbo3771
« Reply #51 - Posted 2014-06-12 18:21:14 »

I like how the "Genius Coder" tries to buy solutions, I never even realised there was 2 thread. Each the same with a different reward.

Heres an idea, debug and fix your own problems. People here are helpful individuals that are here on their own accord, not here to look for money.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline Rayvolution

« JGO Spiffy Duke »


Medals: 219
Projects: 2
Exp: 1 year


Resident Crazyman


« Reply #52 - Posted 2014-06-12 18:41:19 »

I like how the "Genius Coder" tries to buy solutions, I never even realised there was 2 thread. Each the same with a different reward.

Heres an idea, debug and fix your own problems. People here are helpful individuals that are here on their own accord, not here to look for money.

Well, to be fair (not really defending anyone here) I think the other thread was ripped out of this one and chitchatted, he's probably just not aware of the chitchat board stuff. Cheesy

- Raymond "Rayvolution" Doerr.
Retro-Pixel Castles - Survival Sim/Builder/Roguelike!
LIVE-STREAMING DEVELOPMENT: http://www.twitch.tv/SG_Rayvolution
Online Gibbo3771
« Reply #53 - Posted 2014-06-12 18:59:34 »

I like how the "Genius Coder" tries to buy solutions, I never even realised there was 2 thread. Each the same with a different reward.

Heres an idea, debug and fix your own problems. People here are helpful individuals that are here on their own accord, not here to look for money.

Well, to be fair (not really defending anyone here) I think the other thread was ripped out of this one and chitchatted, he's probably just not aware of the chitchat board stuff. Cheesy

Well in that case he has upped the reward, still rubs me wrong.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline matheus23

JGO Kernel


Medals: 113
Projects: 3


You think about my Avatar right now!


« Reply #54 - Posted 2014-06-12 19:02:14 »

Well in that case he has upped the reward, still rubs me wrong.

I also doubt that he'd be able to pay it, since he's so young, but that's just speculation, and probably rude ^^

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Genius Coder

Junior Devvie


Medals: 1
Exp: 4 years



« Reply #55 - Posted 2014-06-12 20:49:10 »

Yen I had forgotten about the previous thread. I come from a well of family and have a job myself so to answer you question,  yes I can afford it thank you and no offence taken. I would approve of this thread being removed and destroyed now and I shall think carefully before I create another thread. But I thank you all for your input

I love making games...
Offline Genius Coder

Junior Devvie


Medals: 1
Exp: 4 years



« Reply #56 - Posted 2014-06-14 11:10:53 »

I thankyou all for helping and attempting toi solve my problem. Im extremely happy to announce that I found the problem. Grin
So apparently the solution was to simply add another line of code for the UV's as shown here:

1  
         UVs.put(asFloats2f(m.uvcoord.get((int) face.uv.z - 1)));


I think we can all agree that I have learnt a valuable lesson here though. I know for sure that I will never create another thread again with a reward and that I should be polite to all members despite how I think I should behave. Once again I thankyou all for your help and if i could I would give you all a gold star Grin Thankyou for teaching me the ways and I apologies for any inconvenience I have caused.

I love making games...
Pages: 1 [2]
  ignore  |  Print  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (23 views)
2014-11-22 12:13:56

xFryIx (69 views)
2014-11-13 12:34:49

digdugdiggy (48 views)
2014-11-12 21:11:50

digdugdiggy (42 views)
2014-11-12 21:10:15

digdugdiggy (36 views)
2014-11-12 21:09:33

kovacsa (60 views)
2014-11-07 19:57:14

TehJavaDev (64 views)
2014-11-03 22:04:50

BurntPizza (62 views)
2014-11-03 18:54:52

moogie (77 views)
2014-11-03 06:22:04

CopyableCougar4 (77 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!