Question

I'm using JPCT-AE and I am trying to put my camera inside of a sphere, but it simply isn't showing anything. If I set the camera to outside of the same pointing at it, then I can see the shape.

    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've tried simply commenting and uncommenting various areas of the code, but I am just getting nowhere.

Was it helpful?

Solution

Turns out I had culling turned on.

mSphere.setCulling(false);

Fixed it :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top