jPCT-AE - a 3d engine for Android > Support

Vuforia / jpct / load 3D Model

(1/2) > >>

Bin:
Hi,

after i integrated Vuforia with jpct i saw the cube on my target.

ok.

But now i want to change the cube with my own model. how can i do that?



thanks

Maro:
Assuming you want to load on obj model you need to:
1 create an array of object3d
2 load that obj into an input stream
3 load the mtl in another input stream
4 inizialize array with the right function

an example of code here:

--- Code: ---public Object3D[] model;
public AssetManager mngr;
public InputStream objStream = null;
public InputStream mtlStream = null;

//into your constructor
public yourconstructor()
{
.
.
.
mngr = instanceofactivity.getAssets();
try {
objStream = mngr.open("file.obj");
} catch (IOException e) {
e.printStackTrace();
}
try {
mtlStream = mngr.open("file.mtl");
} catch (IOException e) {
e.printStackTrace();
}
   
model = Loader.loadOBJ(objStream, mtlStream, x);
.
.
.
}

--- End code ---
In this case i put my file into the assets folder.
Hope can be helpful!

Bin:
Great!

It works.

But now i tried to export the md2 File from Blender with an KeyFrame animation,
and put the new md2File in the assetsFolder.

After exporting it as an App, it just shows me that 3D model without animation.

Do you know how it works?

EgonOlsen:
Are you actually calling animate(...) on it?

Bin:
Hi,

no i didn`t.

Do you have a Sample how to do that?

Navigation

[0] Message Index

[#] Next page

Go to full version