Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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: Can individual objects from a scene be manipulated?  (Read 6635 times)
0 Members and 1 Guest are viewing this topic.
Offline ImTroyMiller
« Posted 2014-02-24 03:56:02 »

I've loaded a basic 3D scene(created in Blender) into LibGDX, that contains a few basic objects(a sphere, a cone, and a cube).  Everything looks fine.

From here, is it possible to move the cube without moving the other objects?

I am very new to this, so it's just a general question.
Offline Longarmx
« Reply #1 - Posted 2014-02-24 04:07:04 »

It depends on what you mean by move and whether they are in separate meshes. If you mean move th around in blender them yes, that is possible if they are all separate meshes. In code, yes, you should be able to move just the cube since they are all based off of a single origin, and not each other.

Offline ImTroyMiller
« Reply #2 - Posted 2014-02-24 04:31:49 »

Yes, I meant all separate meshes.

Thank you for answering.

How would I move the cube?  It's named "Cube" within Blender(if it matters), and the model is called "myModel", which has many methods, two of those methods are 'meshes' and 'meshParts'.

My ModelInstance of the above model is called "modelInstance".
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ImTroyMiller
« Reply #3 - Posted 2014-02-27 08:55:37 »

Well I now know that using the transform method of the models instance will give me methods to rotate and move a model, but I still don't know how I would move an object within that model.

Are there any good tutorials on 3D development using LibGDX?  I've search and I've only found a few blogs that cover loading the model, but none that actually cover moving/rotating the object.
Offline Gibbo3771

JGO Kernel


Medals: 128
Projects: 5
Exp: 1 year


Currently inactive on forums :(


« Reply #4 - Posted 2014-02-27 09:17:23 »

LibGdx is mainly a 2D library, tutorials are scarce.

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

Senior Devvie


Medals: 9



« Reply #5 - Posted 2014-02-27 11:14:28 »

Have you ever used cameras, I think that you are looking for a transformation-matrix  Smiley
Offline ImTroyMiller
« Reply #6 - Posted 2014-02-27 20:02:30 »

The only camera usage experience I have is modeling in Blender,  which I have just started.

Would Unity be a better option?
Offline Longarmx
« Reply #7 - Posted 2014-02-28 04:34:45 »

1  
cubeModelInstance.transform.setToTranslation(x, y, z);


source: http://blog.xoppa.com/loading-models-using-libgdx/ (3 code blocks down)

Offline ImTroyMiller
« Reply #8 - Posted 2014-02-28 06:56:53 »

1  
cubeModelInstance.transform.setToTranslation(x, y, z);


source: http://blog.xoppa.com/loading-models-using-libgdx/ (3 code blocks down)

That's the blog that taught me how to load in the models.

The code works to mov the object around, and I can use other methods of translation to rotate a model, but I want a tutorial that'll help me implement some of the modifications that I have added in Blender.
Pages: [1]
  ignore  |  Print  
 
 

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

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

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

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

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

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

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

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

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

Solater (175 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
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!