Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (769)
Games in Android Showcase (230)
games submitted by our members
Games in WIP (856)
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  
  Translating OBJ Models  (Read 2586 times)
0 Members and 1 Guest are viewing this topic.
Offline crastyrs

Junior Newbie


Exp: 3 years


AS


« Posted 2013-05-01 21:12:12 »

I'm trying to create a chess game with LWJGL. How is it possible to move the pieces if I'm using VBOs and the data is stored in OBJ models? In other words, how do I translate the vertices?
Offline relminator
« Reply #1 - Posted 2013-05-02 11:10:17 »

Store your objects in local space and move by transforming your objects via a matrix transform.
Offline crastyrs

Junior Newbie


Exp: 3 years


AS


« Reply #2 - Posted 2013-05-02 19:48:05 »

How do I do this matrix transform with LWJGL? All the tutorials I've read are written in C++ and use a library such as GLM
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gouessej
« Reply #3 - Posted 2013-05-02 20:41:38 »

Call glPushMatrix(), glTranslate() and glPopMatrix(). I advise you to learn OpenGL basics if you want to use any low level Java binding for the OpenGL API.

Julien Gouesse | Personal blog | Website | Jogamp
Offline crastyrs

Junior Newbie


Exp: 3 years


AS


« Reply #4 - Posted 2013-05-03 00:17:43 »

I know how to do that, but I'm looking for a method that isn't deprecated.
Offline theagentd
« Reply #5 - Posted 2013-05-03 16:20:59 »

If, and only if, you're using LWJGL you should consider using the Matrix4f and Vector3f classes to create a transformation matrix, store it into a FloatBuffer using Matrix4f.store() and finally upload it to your shader using glUniformMatrix4(). Or if you're using JOGL, Gouessej is your man.

Myomyomyo.
Offline gouessej
« Reply #6 - Posted 2013-05-03 16:27:09 »

If, and only if, you're using LWJGL you should consider using the Matrix4f and Vector3f classes to create a transformation matrix, store it into a FloatBuffer using Matrix4f.store() and finally upload it to your shader using glUniformMatrix4(). Or if you're using JOGL, Gouessej is your man.
In that case, I should have advised him to use PMVMatrix.

Julien Gouesse | Personal blog | Website | Jogamp
Offline crastyrs

Junior Newbie


Exp: 3 years


AS


« Reply #7 - Posted 2013-05-03 20:50:22 »

Thanks! Are there any articles or tutorials on how to do that?
Pages: [1]
  ignore  |  Print  
 
 

 
EgonOlsen (1674 views)
2018-06-10 19:43:48

EgonOlsen (1722 views)
2018-06-10 19:43:44

EgonOlsen (1161 views)
2018-06-10 19:43:20

DesertCoockie (1587 views)
2018-05-13 18:23:11

nelsongames (1187 views)
2018-04-24 18:15:36

nelsongames (1716 views)
2018-04-24 18:14:32

ivj94 (2541 views)
2018-03-24 14:47:39

ivj94 (1767 views)
2018-03-24 14:46:31

ivj94 (2847 views)
2018-03-24 14:43:53

Solater (972 views)
2018-03-17 05:04:08
Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08

Deployment and Packaging
by gouessej
2018-08-22 08:03:45

Deployment and Packaging
by philfrei
2018-08-20 02:33:38

Deployment and Packaging
by philfrei
2018-08-20 02:29:55

Deployment and Packaging
by philfrei
2018-08-19 23:56:20

Deployment and Packaging
by philfrei
2018-08-19 23:54:46
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!