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

#1
Support / Unexpected Texture rendering.
October 05, 2013, 01:12:16 PM
Hello,

   I am trying to add a texture to a sphere (PlanetTexture1.png attached) but I find that it is  rendered a plain green as in the screenshot (Screenshot.png also attached). Here is the code I am using:

Texture Manager:
    planet1Texture = new Texture(assetManager.open("PlanetTexture1.png"));
    TextureManager.getInstance().addTexture("PlanetTexture1.png", planet1Texture);

The model object:   
     planet1 = Primitives.getSphere(5.0f);
    SimpleVector planetPos = new SimpleVector();
    planetPos.set(25, 0, 30);
    planet1.setOrigin(planetPos);
    planet1.setTexture(ti1);
    planet1.build();
    planet1.strip();
    world.addObject(planet1);
 
Add texture to model:
TextureInfo ti1 = new TextureInfo(TextureManager.getInstance().getTextureID("PlanetTexture1.png"));

What do I need to add to get that texture rendered as I would see it in the png file?

[attachment deleted by admin]