Author
Topic: Help! My stick figure doesn't do what I want it to (Read 2498 times)

Hello all, I have been perusing the forum quite a bit trying to learn jPCT and put it to test. I must say that I am a total noob to the 3D world, but not to Java. So to get my feet wet I grabbed Blender and followed one of their tutorials (not to completion, I must admit, as I already had somewhat of a "thing" that didn't look as pathetic as a simple cube); then I downloaded the 1.13 beta so I could import the .obj file, and off I went.

What I am trying to achieve is this:

1. Load a 3D model from an .obj that may contain different "areas" (forgive my non-3D vocabulary)2. Apply different textures to different areas, and allow the user to change them at runtime3. Rotate the image on the Y axis so a user can view the stick figure as if the camera was rotating 360 degrees around it.4. I don't want a continuous loop for rendering the world. My requirement is to have a static view of the model and only when the user wants to pan around it can that be done (by dragging the mouse, for instance)

So I started by picking off code that I found on the forum, and retrofitted it to suit my needs. jPCT loads the model fine but when I apply the texture the stick figure only gets darker (perhaps there is something wrong with my primitive model?). Further, I can't quite get the rotation part figured out for the life of anything. My stick figure rotates, but not necessarily as I want it to.

I do believe that I can achieve what I want by using jPCT; I've seen the demos and the rendering it does, so I am sure displaying a model, applying/changing textures, rotating the model is not out of its league.

I hope someone can throw me a bone because I am starting to get to the point where frustration is starting to set in. General questions I still have are:

a) How could I group the Object3D objects that result from Loader.loadOBJ() into "logical" groups" Say, I want to be able to apply different pant textures to the legs, and different shirt textures to the torso.b) What is the best way to make my model fit the frame I created? Is there a method I can call for this or do I have to do the math and figure it out? If so, how do the dimensions (in 3D) of the stick figure translate to the frame's XY coordinates?

I'll stop myself short here before this gets too insanely long and people decide not to help :-) URL, code and model follow, thanks!

There is something like:Group by object - One object in the OBJ == one blender object.Group by group - One object in the OBJ == one vertex group in blender.

It might be possible, yes.You can name the vertex groups, or objects in blender, and they are accessible in jPCT, to my knowledge.

Its 12:56am, so I cant answer everything, but someone will:).

About your model's rotation. I did not have time to read your pasted source code, but one thing worth noting, in case you did not know, is that Y is down in jPCT, and Z is up in Blender.

I mean, the vertical axis is the Z axis in blender, and larger numbers move the model up.In jPCT, the Y axis is the vertical one, and larger numbers move the model down.

Its a simple thing. You just rotate the objects mesh by 90 degrees when you load it. There are examples on the forum. Its only a few lines.Perhaps you have compensated already, and I am in error for not reading your source:).

EDIT:For screen space to 3d world space coordinate conversion, there is a class called Interact2D3D, or something that effect.I had to ask about this a few weeks ago also:)

I've deleted the doubled post, but maybe i've deleted the wrong one? The model posted in this thread is everything but a person. It's a bunch of vertices only. Can you please correct it to be a usable model? Sorry, if i was a little bit "trigger happy" when deleting that other thread.... :oops: