Results 1 to 8 of 8
  1. #1
    Theloneslaya is offline Member
    Join Date
    Apr 2013
    Posts
    12
    Rep Power
    0

    Question how to load in, and render a 3d model into a 3d game help

    I've searched all over the web, youtube mainly and couldn't find anything to help me with this.
    I have no idea on how to do it because im starting to design a 3d game and i want to learn step by step.
    If anyone could explain or recommend a webpage to help me with it, i'd be happy.

    Here's the problem: I have a few blender files (exported as .obj) and i want to load them into my game and use them in my level. I have no idea, and im already useing lwjgl.
    Thanks alot.

  2. #2
    drt_t1gg3r is offline Member
    Join Date
    Jun 2014
    Location
    Oregon, USA
    Posts
    1
    Rep Power
    0

    Default Re: how to load in, and render a 3d model into a 3d game help

    I know this thread is 9 months old, but I came across this question while looking for the same answer. However, if anyone else is looking (like I was) You can see a video on loading and rendering 3D models below:

  3. #3
    Xyle's Avatar
    Xyle is offline Member
    Join Date
    Feb 2009
    Location
    Nevada
    Posts
    49
    Rep Power
    0

    Default Re: how to load in, and render a 3d model into a 3d game help

    I haven't used 3d in Java, but since your on the right track already I thought I could post some helper areas!

    graphics - How do I use Blender models in Java? - Stack Overflow

    Importing Blender Models (.obj) to LWJGL - LWJGL <--- the same link provided by drt_t1gg3r

    How to load 3D models into Java? - Game Development Stack Exchange <--- I agree with the JmonkeyEngine recommendation, there is a lot of stuff there that you can use, why reinvent the wheel? Spend more time prototyping your game instead of figuring out how to load models. This is where using a 3rd party engine takes the brunt of the work load away so you can focus on actually making the game.

    MyKaruga <-- wrote a specific Java LWJGL loader, worth taking a look at

  4. #4
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,763
    Rep Power
    6

    Default Re: how to load in, and render a 3d model into a 3d game help

    Quote Originally Posted by Xyle View Post
    why reinvent the wheel?
    I always found that an interesting question actually, I'm glad that you rhetorically ask it and I'm going to abuse the situation to respond to it without anyone asking for it.

    I don't want to reinvent the physical wheel since that design already exists, but I don't see writing complicated machinery yourself at least once as reinventing something - its part of the learning experience. Compare it to electronics: you don't know how it ticks until you take it apart.

    In programming its rarely any use to stare at large piles of existing code unless your goal is to know how to rip off and use existing code without understanding it, so you're better off starting from requirements and building the stuff yourself to really learn it. As such - I wouldn't recommend using JMonkeyEngine for your first games. Use Java and LWJGL, or LibGDX. Of course then you also don't load models, you would create some easier 2D games and then some cube worlds. The point being that you learn how 3D hardware rendering, network programming and sound output actually works before you start using complicated tooling such as game engines that assumes you already understand all that.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    Xyle's Avatar
    Xyle is offline Member
    Join Date
    Feb 2009
    Location
    Nevada
    Posts
    49
    Rep Power
    0

    Default Re: how to load in, and render a 3d model into a 3d game help

    Very good points.

    In the end, it all depends on what your trying to achieve. Do you want to drive a car or figure out how everything in the car works?

    Some people just want to spend most of their time focusing on their game, while other people may choose to write their own tile editor, model importer, shadow system, sprite manager, etc and use those tools for their game instead of using whats already out there.

    Personally when I look back at some of the directions I went, I regret them due to the amount of time lost. Yes, there was definitely a gain in knowledge and experience, but I believe I would be further along in my hobby game programming if I wouldn't have dissected certain things so much.

    Thanks for the input! It is very much appreciated!

  6. #6
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,763
    Rep Power
    6

    Default Re: how to load in, and render a 3d model into a 3d game help

    Quote Originally Posted by Xyle View Post
    Very good points.

    In the end, it all depends on what your trying to achieve. Do you want to drive a car or figure out how everything in the car works?
    That's again an unfair comparison; then you'd have to compare playing a game to building one - indeed for playing games you don't need to know anything. No this is only about building a car - do you then only learn how to push the buttons of the machines involved and where to put the screws, or do you also learn how all the individual components tick and what are good practices for vehicle construction in general?

    EVENTUALLY you'll just be able to hammer a car together with all the high level tools you have available to you, but when you start out you learn everything there is to know about cars and engineering.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  7. #7
    Xyle's Avatar
    Xyle is offline Member
    Join Date
    Feb 2009
    Location
    Nevada
    Posts
    49
    Rep Power
    0

    Default Re: how to load in, and render a 3d model into a 3d game help

    Again, good points.

    As I said, it all depends on what your goals are. Personally I don't want to write my own model exporter, shader system, tile editor, or complete game engine. These tools already exist and more than likely a lot better versions than I can make myself.

    So back to your analogy, are you going to build the hammer, wrenches, machines used to create the car? Or are you going to pick and choose the best tools and equipment to put the car of your dreams together?

    :)

  8. #8
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,763
    Rep Power
    6

    Default Re: how to load in, and render a 3d model into a 3d game help

    No you're not going to build your own Java compiler. Again - a VERY unfair comparison.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. how to save and load and pause a game ?
    By paris72 in forum Java Gaming
    Replies: 4
    Last Post: 01-05-2014, 10:21 PM
  2. Game render and tick method
    By phantomcraft in forum New To Java
    Replies: 1
    Last Post: 05-14-2013, 04:26 PM
  3. load 3d model , update it and render using java
    By mihir_amreli in forum Java Gaming
    Replies: 3
    Last Post: 02-13-2013, 07:44 PM
  4. Replies: 5
    Last Post: 04-29-2012, 03:05 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •