Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - aeroxr1

Pages: 1 2 3 [4] 5 6
46
Bones / Re: Animate rigged model according to given commands
« on: September 06, 2014, 08:38:59 pm »
just move the camera to other part of model. or rotate the model.

you can move camera closer to make the model look bigger. or you can scale the model.

onSurfaceChanged is called every time the surface is created. just read the docs:)


Quote
Called when the surface changed size.

Called after the surface is created and whenever the OpenGL ES surface size changes.

Typically you will set your viewport here. If your camera is fixed then you could also set your projection matrix here

I didn't see this line -.-"""" sorry  ::)

Another stupid question :
when I import a new model, in what position will be place ? 0,0,0 ? :D
I imagine is very stupid question, but I know little of 3d graphics -.-"



47
Support / Re: Development suggestions ?
« on: September 06, 2014, 09:54:58 am »
THanks :)
Another question, what are the differents between OnsurfaceCreated,OnsurfaceChanged and onDrawFrame ?

Because after I read the google official reference I thought that :
OnSurfaceCreated was running only once time
OnSurfaceChanged was running every time the direction of the screen changes
onDrawFrame I'm not very sure, but is the function that renders all the scene ?

But in the example presents on the jpct the things seems a bit different.

For example in deadzombie the world is created in onsurfacechanged , but if the screen will never be rotated ?

sorry for too questions..  :-[

48
Bones / Re: Animate rigged model according to given commands
« on: September 05, 2014, 07:17:59 pm »
I set the camera in this way :

Code: [Select]
cam.moveCamera(Camera.CAMERA_MOVEOUT, 50);
cam.lookAt(new SimpleVector(0, -box_h/2, box_h));

protected float[] calcBoundingBox() {
float[] box = null;

for (Animated3D skin : modello) {
float[] skinBB = skin.getMesh().getBoundingBox();

if (box == null) {
box = skinBB;
} else {
// x
box[0] = Math.min(box[0], skinBB[0]);
box[1] = Math.max(box[1], skinBB[1]);
// y
box[2] = Math.min(box[2], skinBB[2]);
box[3] = Math.max(box[3], skinBB[3]);
// z
box[4] = Math.min(box[4], skinBB[4]);
box[5] = Math.max(box[5], skinBB[5]);
}
}
return box;
}

and the result is :


it isn't as I wanted  :(

I would set the camera in front of the model :( Where did I wrong ?

And I have seen helloworld and other jpct-ae's examples and in all of those the world is created in onSurfaceChange; it works but how ? Does Onsurfacechange runs only when the display is rotated ?

And another things, is there a function to scale the model in landscape mode ? I mean when I rotate the display from portrait to landscape mode the human model has to become little :D

49
Support / Development suggestions ?
« on: September 05, 2014, 04:17:27 pm »
Hi :)
I'm new in jpct and in 3d programmation.

Have you some suggestions to give me ?

For example, on official google opengl it divide in 3 different files :

GLSurfaceView.Renderer
GLSurfaceView
and mainactivity

then it extends GLSurfaceView in something like this :
public class MyGLSurfaceView extends GLSurfaceView

I tryed to do in this way but some more doubts has appeared to me  :-\

Can I define world in renderer class ?
How can I access to res from the class that not extend activity ?

Put this code in onSurfaceCreated is equal to put it in oncreate() ?

Code: [Select]
Resources res = getResources();
modello = BonesIO.loadGroup(res.openRawResource(R.raw.vincent));
modello.addToWorld(world);

Do you suggest me the correct approach ?

50
Support / Re: keepPixelData ?
« on: September 05, 2014, 10:12:25 am »
ah now I understand :)
And now a bit off topic :
have you some link of guide/turorial or book to suggest me where it explain the basics of graphic 3d programmation ?
And another that explain how can I applicate the quaternions,rotation matrix ecc ecc for 3d graphics :)

thanks for everything :)


 

51
Bones / Re: Animate rigged model according to given commands
« on: September 04, 2014, 08:10:12 pm »
Hi :)
why I have to put the bones file in the animatedgroup and not in animate3d ?

(i watched ninja bones android demo)

Quote
masterNinja = BonesIO.loadGroup(res.openRawResource(R.raw.ninja));

And why the texture is applicate in this for function ?
Code: [Select]
for (Animated3D a : masterNinja)
a.setTexture("ninja");

If I have only one bones file with only one 3d model , do I have to do  same thing ?

52
Support / keepPixelData ?
« on: September 04, 2014, 08:00:32 pm »
Hi :)
I'm newbie in 3d programmation and I never used opengl.
I started from the simple helloworld example and after I have downloaded Ninja Bones .
(because I would animate a rigged model)
There are some functions that I don't know what they do, one of them is keepPixelData().

Quote
keepPixelData

public void keepPixelData(boolean keepData)
Should a texture's pixels be kept even when the texture has been uploaded to the GPU? Default is false.
Parameters:
keepData - should they?

But what it's meaning ? I don't understand :(

53
Bones / Re: Animate rigged model according to given commands
« on: September 03, 2014, 07:32:57 pm »
 8)

54
Bones / Re: Animate rigged model according to given commands
« on: September 03, 2014, 05:51:40 pm »
Where do you suggest to create the model ?

in the onSurfaceCreated function ? Or is better if I create the model in an other function ? :)

55
Bones / Re: Animate rigged model according to given commands
« on: September 03, 2014, 03:23:26 pm »
and you refer to it using R.raw.yourfile . Perfect :)

56
Bones / Re: Animate rigged model according to given commands
« on: September 03, 2014, 02:56:33 pm »
Another question  ;D

Where I have to put the .bones file in an Android project ?

In the asset folder right ? :)

57
Bones / Re: Animate rigged model according to given commands
« on: September 02, 2014, 06:35:15 pm »
thanks :D

58
Bones / Re: Animate rigged model according to given commands
« on: September 02, 2014, 04:47:32 pm »
I use this function to load my models :
Code: [Select]
private AnimatedGroup loadNinja() throws Exception {
FileInputStream fis = new FileInputStream("./samples/data/ninja/vincent.group.bones");
try {
AnimatedGroup skinnedGroup = BonesIO.loadGroup(fis);

Texture texture = new Texture("./samples/data/ninja/Vincent_new_UV.png");
TextureManager.getInstance().addTexture("ninja", texture);

for (Animated3D o : skinnedGroup) {
o.setTexture("ninja");
o.build();
o.discardMeshData();
}
return skinnedGroup;
} finally {
fis.close();
}
}

After I have imported it, do I have to use this following functions to refer to index ?

Code: [Select]
SkeletonPose currentPose=animatedGroup.get(0).getSkeletonPose();
currentPose.getSkeleton().getJoint(index);

59
Bones / Re: Animate rigged model according to given commands
« on: September 02, 2014, 04:12:29 pm »
yes but in procedural example it imports collada model while I have model in bones format .
If I import the file .bones, the bones and joints are automattically imported ?
If I want to refer to determinated joint or bone what do I have to do ?


60
Bones / Re: Animate rigged model according to given commands
« on: September 02, 2014, 03:49:58 pm »
If you have no animations listed under "Object Settings>Mesh Animations" there won't be a skeleton (or there will, but it won't describe any animations) and Bones won't load your model.

Personally, I think that it should load any model with a .seleton.xml file, whether or not there are animations, so that you could animate your models programmatically...

Hi it's me again :)
I correctly exported the 3ds rigged model to bones format , but now I want to programmatically animate it.
Which bones's functions do I have to look at ?
Which are the steps that I have to follow ?
( I have to move the leg of the human model )

Pages: 1 2 3 [4] 5 6