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

Topics - yindroid

#1
Support / How to get vertex from animated mesh?
August 21, 2012, 12:14:22 PM
Hi!
I would like to try add(attach) some primitives (like spheres as eyes) to animated mesh. So I decide to get one verticle from mesh and use its coords and normal to attach some primitives.
there is my code, but there is one problem: the animation stoped to work(like set on pause or smth like that)...


public class Player extends Object3D{

    public Player(Context AppContext, World world, Resources res) {   
        // loading and setting stuff...
   
        vc = new VertexController(20);
        this.getMesh().setVertexController(vc, true);
        this.getMesh().applyVertexController();

        world.addObject(this);
    }

    /* VERTEX CONTROLLER */
    private static class VertexController extends GenericVertexController {
        private int vertexID;
       
        VertexController(int pVertexID) {                 
          this.vertexID = pVertexID;
        }

@Override
public void apply() {
    SimpleVector[] srcMesh = this.getSourceMesh();       
            int size = this.getMeshSize();
            if(vertexID < size){
        mVertexX = srcMesh[vertexID].x;
        mVertexY = srcMesh[vertexID].y;
        mVertexZ = srcMesh[vertexID].z;
            }
        }
}


In main update cycle:

public void onDrawFrame(GL10 gl) {

    // player animation code

    player.getMesh().applyVertexController();
    player.touch();
}


Maybe there is some other way to handle it?
#2
Support / Multitexturing and UV coords
April 22, 2012, 12:08:44 PM
Hi, guys!
I know how to make multitexturing with 2 textures, so can I use more than 2 textures?
And the second question; Is there any way to change UV coords to all multitexture layers? (I managed to change UV coords just for one layer with setTextureMatrix() )

Thanks in advance!
#3
Support / About texture filtering
January 22, 2012, 02:54:26 PM
Hi!

I have a little confusion about texture filtering, I made a simple plane-Object3D ( quite big ) and texture size is 256x256 pixels - texture looks a bit distorted like a grainy patern. I'm not sure how to fix that :/
there is screenshot sample attached:


Thank you in advance!
#4
Support / Cube mapping and transparecny
January 02, 2012, 08:55:16 PM
Hi everyone!
I would like to know, is there any way how to make texture semi-transparent if using cubemapping?
this is my code:

//for interval 0..255
Config.glTransparencyMul = 0.0039f;
Config.glTransparencyOffset = 0f;

TextureManager tm = TextureManager.getInstance();
tm.addTexture("glass", new Texture(mUtils.getScaledBitmapFromAssets(256,256,"gfx/glass.jpg", AppContext), true));
Glass.setTexture("glass");
Glass.setEnvmapped(Object3D.ENVMAP_ENABLED);
Glass.setEllipsoidMode(Object3D.ELLIPSOID_ALIGNED);
Glass.setTransparency(100);

p.s. works without using cubemapping!
Thanks in advance
#5
Support / [solved] Texture artifact
November 19, 2011, 04:04:37 PM
Hi there!
So, there is my problem. On my overlay i'm adding texture(512x512). Then I have to strech overlay to 512x600. After this artifact appears as horizontal black line. I tried to use texture with resolution 512x1024 and it works great, but it is waste of resources...

Thanks in advance
#6
Support / [SOLVED]Overlay's rotation center
November 08, 2011, 12:58:27 PM
Hi, everyone!
I wonder if there is any way to change overlay's rotation center?
Thanks
#7
Hi, gyus. I'm new here.
At first I have to thanks jPCT creator for fantastic work, it looks promising.
About my problem, what is the proper way to get textures with alpha blending works? I use png with alpha chanel, but result is not  what I expected(only black areas ar transparet) This is my code:

//loading texture
TextureManager.getInstance().addTexture("panda", new Texture(getBitmapFromAssetsARGB8888(256,256,"gfx/alpha.png", AppContext));

//seting up 3dobject
planePanda = Primitives.getPlane(1, 10);
planePanda.setTexture("panda");
planePanda.setTransparency(3); //not sure how it works
planePanda.build();
world.addObject(planePanda);


Thanks!