relationship bwtween code and models

Started by riscbus, December 01, 2014, 03:56:40 AM

Previous topic - Next topic

riscbus

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...

riscbus

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

EgonOlsen

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...

riscbus

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

Irony

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.

riscbus

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,

EgonOlsen

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.

Irony

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.

riscbus

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? :)


riscbus

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  :)