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 - kennydude

#1
Support / Fit Texture to Sphere
May 06, 2013, 08:10:44 PM
Hi, I'm trying to fix a texture to a sphere. However, it only shows part of the texture.

A texture in my app can look like this - http://i.imgur.com/dT7vDlY.jpg (the red parts will be changed in the future, just for reference)

However, I can only see the red area on my device using


public void setupWorld(){
mSphere = Primitives.getSphere(SPHERE_RADIUS);
mSphere.setCulling(false);
mSphere.setTexture("sphere");
mSphere.build();

mWorld = new World();
mWorld.setAmbientLight(200,200,200);

mWorld.addObject(mSphere);

Camera camera = mWorld.getCamera();
camera.moveCamera( Camera.CAMERA_MOVEOUT, 30 );
//camera.setPosition( mSphere.getTransformedCenter() );
camera.lookAt( mSphere.getTransformedCenter() );
//camera.moveCamera(Camera.CAMERA_MOVEIN, 5);

MemoryHelper.compact();
}


If someone could tell me what I'm doing wrong, that would be fantastic :)

Joe :)

p.s the whole code is Open Source @ https://github.com/kennydude/photosphere/tree/master/Android
#2
Thank you so much!

That worked perfectly <3
#3
I'm trying to make JPCT-AE render inside of a shape. Basically, I am inside of a sphere primitive and I want to display a texture.

However, I can't get the texture to show up when I move the camera inside of the sphere. I can make it show by moving outside of the shape though, which is odd and annoying.

Here is my basic code at the moment:

    Texture texture = new Texture(3000, 3000, RGBColor.RED);
    TextureManager.getInstance().addTexture("sphere", texture);

    mSphere = Primitives.getSphere(20);
    //mSphere.calcTextureWrapSpherical();
    mSphere.setTexture("sphere");
    mSphere.build();

    mWorld = new World();
    //mWorld.setAmbientLight(50,50,50);

    mWorld.addObject(mSphere);

    Camera camera = mWorld.getCamera();
    //camera.moveCamera( Camera.CAMERA_MOVEOUT, 30 );
    //camera.setPosition( mSphere.getTransformedCenter() );
    camera.lookAt( mSphere.getTransformedCenter() );
    //camera.moveCamera(Camera.CAMERA_MOVEIN, 5);

    MemoryHelper.compact();


I have tried many variations of the code (commenting and uncommenting areas) but it just refuses to render the red colour at all.