Author Topic: relationship bwtween code and models  (Read 1392 times)

Offline riscbus

  • byte
  • *
  • Posts: 15
    • View Profile
relationship bwtween code and models
« on: December 01, 2014, 03:56:40 am »
Now, I find the biggest problem is : I can't understand the relationship between src code and models

so any demo is begin with modeling NOT coding?

I wish I can make a simple running man(very simple model with a animation), and make it run on my mobile screen.

many thanks...

Offline riscbus

  • byte
  • *
  • Posts: 15
    • View Profile
Re: relationship bwtween code and models
« Reply #1 on: December 01, 2014, 04:08:14 am »
In J2ME JSR184 time, I make model with blener, export to m3g format

each object should identify with an ID #CodeName, we find the  object with this ID

now with jpct, shall we do sth special when we modeling?

and same question about texture & animation

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11744
    • View Profile
    • http://www.jpct.net
Re: relationship bwtween code and models
« Reply #2 on: December 01, 2014, 08:42:12 am »
I'm not really sure what the actual question is? jPCT loads 3ds, obj and md2 by default and can also handle Collada and Ogre for animation when using Bones. Just model your object and export it into one these formats...

Offline riscbus

  • byte
  • *
  • Posts: 15
    • View Profile
Re: relationship bwtween code and models
« Reply #3 on: December 01, 2014, 11:43:55 am »
err... In simple words, I have question in texture now

My model has a texture, I load mesh & texture, how the texture find it's place to the Object3D? which is the top-left point? how to define it?

Of course, I am not good at modeling, so I want to now how to modeling a simple thing and put it to my project.

In this way, I could understand how jpct works better

Offline Irony

  • long
  • ***
  • Posts: 151
    • View Profile
Re: relationship bwtween code and models
« Reply #4 on: December 01, 2014, 12:10:07 pm »
Don't jump three steps ahead. I strongly suggest you first implement and UNDERSTAND the sample code given here: http://www.jpct.net/wiki/index.php/Hello_World_for_Android
Everything else comes from there. It's a learning process. No way around that.
But, if you are more into design than coding, you could either
a) get a coder
b) use a tool like Unity that lifts a lot of the coding for you.

Offline riscbus

  • byte
  • *
  • Posts: 15
    • View Profile
Re: relationship bwtween code and models
« Reply #5 on: December 01, 2014, 12:24:50 pm »
I have experience in JSR184 coding when feature phone times

and now I work for an android mobile phone design house, mainly working for system app

I want to pick up 3D game as my habit and design simple games for fun  :)

the main problem is lack of model resource and a little hard to understand relationship bwtween code and models

anyway, jpct is a good engine,

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11744
    • View Profile
    • http://www.jpct.net
Re: relationship bwtween code and models
« Reply #6 on: December 01, 2014, 12:32:42 pm »
If your model already has UV (i.e. texture) coordinates, you are almost there. Just load the model, load the texture, call setTexture(...) on your model and...that's basically it. As mentioned, the HelloWorld example should help to get you started. Just make sure that you don't use one of the calc...TextureCoords() calls like the example does, if your model already has proper texture coords.
There's no need to re-texture the model in code or something if that's your question. The code is just for rendering things, the mapping usually comes from the file.

Offline Irony

  • long
  • ***
  • Posts: 151
    • View Profile
Re: relationship bwtween code and models
« Reply #7 on: December 01, 2014, 12:34:40 pm »
Ok. You questions have been pretty vague, so I supposed you had not that much coding experience.
So, have you actually tried the Hello World before? :)

For models, look at Turbosquid, and sort by price. There are quite a lot of free .3ds and .obj.
Most of them have correct UV textures. So, you just have to add the texture to texturemanager, load the model and apply the texture. It's all in the Demos, Wiki, Javadoc... Just go step by step, and don't try to do "a simple running man" as a first step. This is the fourth or fifth step.

Offline riscbus

  • byte
  • *
  • Posts: 15
    • View Profile
Re: relationship bwtween code and models
« Reply #8 on: December 01, 2014, 12:46:59 pm »
I have read through your code, setContextView(GLSurfaceView); and the GLSurfaceView set a render, the render will call onDrawFrame() automaticly

for this demo I have a question:    private static HelloWorld master = null;  and function copy()  use reflect function
your comment said    // Used to handle pause and resume...
 but I don't understand why it is needed

actually, when I design J2ME game with JSR184, the object is stored in m3g file format, which texture is included, so I can load a object3D with texture directly

PS:  at that time, blender has not a exporter for m3g, also a German(named Nalson) developed a m3g exporter for blender. 3D developing is popular in Germany? :)

Offline Irony

  • long
  • ***
  • Posts: 151
    • View Profile
Re: relationship bwtween code and models
« Reply #9 on: December 01, 2014, 01:01:00 pm »

Offline riscbus

  • byte
  • *
  • Posts: 15
    • View Profile
Re: relationship bwtween code and models
« Reply #10 on: December 01, 2014, 03:09:22 pm »
yes, that's quite help

but I know, maybe I am too impatient, I think I should make a plan, step by step learn sth

anyway, thank all the one help me  :)