Main Menu
Menu

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.

Show posts Menu

Messages - alper

#1
I guess i didnt explain very well. I know Mediplayer can stream video but mediaplayer is not play video on the page. When marker is recognized by camera, fullscreen video open. I dont want like that. I want to play like my picture.  Thank you for answers
#2
I know like that with Mediaplayer. However, i need to stream video. is it posible ?
#3
Hi,

Is it possible the streaming video on Texture ? I mean i have URL for streaming video, and i want to stream and play it on my marker (ImageTarget) ?


PS :  Like this photo that attached (this is my IOS app, my marker  is iphone picture, and here is video is streaming. However i ddint do that with Anroid)
#4
Now it is done i did good. Model is more stable not shaking. Thank you brother. Screen is not flowed, it was my mistake. Again thank you. "Where do I start doing onTouchEvent" is my new question :)
#5
When texture and model is loaded, model is vibrating just a little bit. Also, I have planned onTouchEvent and Animation ( I guess i can do that ). So, I think that it will be a problem vibrating model. May be, it is not problem, but i dont know now.
#6
Thanks to you brother. Its solved.
Now, One little question. Model is just a little bit shaking. How do I solve this ?
#7
I did changes you suggested. Here is the code :

public ImageTargetsRenderer(ImageTargets activity) {
this.mActivity = activity;

world = new World();
world.setAmbientLight(50,50,50);

sun = new Light(world);
sun.setIntensity(255, 255, 255);

// Texture texture = new Texture(BitmapHelper.rescale(BitmapHelper.convert(mActivity.getResources().getDrawable(R.drawable.hearse)), 64, 64));
//        TextureManager.getInstance().addTexture("texture", texture);

Config.maxPolysVisible = 1000;
Config.farPlane = 4000;
Config.collideOffset = 500;
Config.glTrilinear = true;

Drawable textureImage = mActivity.getResources().getDrawable(R.drawable.hearse);
Texture texture = new Texture(textureImage);
texture.setClamping(true); // I try with it and without it, its same
        TextureManager.getInstance().addTexture("texture", texture);
       
        if(texture != null)
        {
        Log.i("Texture load", "texture is loaded");
        }

float scaleSize = 1;
try {

carModel = Object3D.mergeAll(Loader.loadOBJ(mActivity.getResources().getAssets().open("hearse.obj"),
mActivity.getResources().getAssets().open("hearse.obj.mtl"),scaleSize));

// carModel = Object3D.mergeAll(Loader.load3DS(mActivity.getResources().getAssets().open("hearse.3ds"), scaleSize));

} catch (IOException e) {
Toast errorToast2 = Toast.makeText(mActivity.getApplicationContext(), "3d model is not loaded", Toast.LENGTH_LONG);
errorToast2.show();
e.printStackTrace();
}
carModel.calcTextureWrap();
carModel.setTexture("texture");
carModel.setLighting(Object3D.LIGHTING_ALL_ENABLED);
carModel.strip();
carModel.build();

world.addObject(carModel);

cam = world.getCamera();
cam.moveCamera(Camera.CAMERA_MOVEOUT, 150);
cam.moveCamera(Camera.CAMERA_MOVEUP, 100);
cam.setFOV(1.5f);

SimpleVector sv = new SimpleVector();
sv.set(carModel.getTransformedCenter());
sv.y += 100;
sv.z += 100;

sun.setPosition(sv);

MemoryHelper.compact();
}


It's probably texture coordinates is okay. I deleted setEnvMapped() method (default is false). And my texture is loading properly (Drawable, and texture constructor has drawable variable). Also, I have no error in code and logcat. However my model is still black. I upload my model and texture. If you want, If it helps, i can upload a picture of modal in my phone...

NOTE: I convert hearse.3ds to .mtl, .obj file format, because when ı load .3ds model it will appear upright on the screen
#8
First, thank you. I will try your advice and again write here. And, yes you're right it's a little bit changed Helloworld example. I have 256*256 .jpg. Also, i already deleted and tried setEnvMapped() method it's same...
#9
public ImageTargetsRenderer(ImageTargets activity) {
this.mActivity = activity;

world = new World();
world.setAmbientLight(50,50,50);

sun = new Light(world);
sun.setIntensity(255, 255, 255);

// Texture texture = new Texture(BitmapHelper.rescale(BitmapHelper.convert(mActivity.getResources().getDrawable(R.drawable.hearse)), 64, 64));
//        TextureManager.getInstance().addTexture("texture", texture);

Config.maxPolysVisible = 1000;
Config.farPlane = 4000;
Config.collideOffset = 500;
Config.glTrilinear = true;

Bitmap textureImage = BitmapHelper.convert(mActivity.getResources().getDrawable(R.drawable.hearse));
Texture texture = new Texture(textureImage);
        TextureManager.getInstance().addTexture("texture", texture);
       
        if(texture != null)
        {
        Log.i("Texture load", "texture is loaded");
        }

float scaleSize = 1;
try {

carModel = Object3D.mergeAll(Loader.loadOBJ(mActivity.getResources().getAssets().open("hearse.obj"),
mActivity.getResources().getAssets().open("hearse.obj.mtl"),scaleSize));

// carModel = Object3D.mergeAll(Loader.load3DS(mActivity.getResources().getAssets().open("stealth.3ds"), scaleSize));

} catch (IOException e) {
Toast errorToast2 = Toast.makeText(mActivity.getApplicationContext(), "3d model is not loaded", Toast.LENGTH_LONG);
errorToast2.show();
e.printStackTrace();
}
carModel.calcTextureWrap();
carModel.setTexture("texture");
carModel.setLighting(Object3D.LIGHTING_ALL_ENABLED);
carModel.setEnvmapped(true);
carModel.strip();
carModel.build();

world.addObject(carModel);

cam = world.getCamera();
cam.moveCamera(Camera.CAMERA_MOVEOUT, 150);
cam.moveCamera(Camera.CAMERA_MOVEUP, 100);
cam.setFOV(1.5f);

SimpleVector sv = new SimpleVector();
sv.set(carModel.getTransformedCenter());
sv.y += 100;
sv.z += 100;

sun.setPosition(sv);

MemoryHelper.compact();
}


My 3d model is appearing its okay, but full of surface is black. I have true width and height .jpg texture file, and i have no error in code. However model is good but its black and i didnt find the solution. Please help me.