Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (784)
Games in Android Showcase (234)
games submitted by our members
Games in WIP (858)
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 7040 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 »

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

source: (3 code blocks down)

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

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

source: (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  

hadezbladez (1643 views)
2018-11-16 13:46:03

hadezbladez (661 views)
2018-11-16 13:41:33

hadezbladez (1640 views)
2018-11-16 13:35:35

hadezbladez (347 views)
2018-11-16 13:32:03

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

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

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

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

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

nelsongames (2973 views)
2018-04-24 18:14:32
Deployment and Packaging
by philfrei
2019-02-17 20:25:53

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 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‑
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!