Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (497)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  LibGDX Load 3D Models  (Read 1387 times)
0 Members and 1 Guest are viewing this topic.
Offline Slyth2727
« Posted 2013-08-14 03:12:56 »

In LWJGL I had to write a .obj loader class to load up my model files which I could then draw with GL_TRIANGLES or GL_POINTS using       glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); in my render before rendering the model. I then went on to add simple lighting and then a shader for normal mapping. I would really love to port this over to LibGDX and then write a tutorial on it because there is such a lack of 3D LibGDX tutorials. My only problem is that apparently I have to use a .png to load a model in LibGDX. How would I load a 3D model in LibGDX and display it without using a texture?
I looked for methods to return the vertices of the .obj in the LibGDX obj loader code but found nothing. Should I code my own obj loader?

I am watching these tutorials for lwjgl: http://www.youtube.com/watch?v=8D1EET8fUtE

I would like to load up and display the rabbit like he has.

Check out Escaping Vox, a 3D
|\ _\  voxel based puzzler!
 \|_|
Offline davedes
« Reply #1 - Posted 2013-08-14 03:19:37 »

http://blog.xoppa.com/loading-models-using-libgdx/

More 3D LibGDX tutorials:
http://blog.xoppa.com/

Also check out the tests whenever you are lost:
https://github.com/libgdx/libgdx/tree/master/tests/gdx-tests/src/com/badlogic/gdx/tests/g3d

Offline Slyth2727
« Reply #2 - Posted 2013-08-14 03:27:47 »

I've already read the xoppa posts but not the g3d tests. They all seem to use textures though after a quick scan of them..

Edit: I know about modelBuilder.createBox, but that isn't exactly very performant.
Edit2:
I have got it working now Smiley. In my previous code I had some weird stuff going on but now it works.

Check out Escaping Vox, a 3D
|\ _\  voxel based puzzler!
 \|_|
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (11 views)
2014-04-15 18:08:23

BurntPizza (10 views)
2014-04-15 03:46:01

UprightPath (23 views)
2014-04-14 17:39:50

UprightPath (10 views)
2014-04-14 17:35:47

Porlus (27 views)
2014-04-14 15:48:38

tom_mai78101 (49 views)
2014-04-10 04:04:31

BurntPizza (107 views)
2014-04-08 23:06:04

tom_mai78101 (207 views)
2014-04-05 13:34:39

trollwarrior1 (176 views)
2014-04-04 12:06:45

CJLetsGame (182 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
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!