Author Topic: how to apply solid color on primitives  (Read 4237 times)

Offline sokobozz

  • byte
  • *
  • Posts: 5
    • View Profile
how to apply solid color on primitives
« on: June 28, 2009, 10:38:51 am »
Hi!

Well I am new in java 3d. I look jpct demos and they look fantastic. I want to quick play with jpct but I have problem with applying simple solid color on primitives. I want to avoid creating textures in Gimp or Blender. Is this possible with jpct?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net

Offline sokobozz

  • byte
  • *
  • Posts: 5
    • View Profile
Re: how to apply solid color on primitives
« Reply #2 on: June 28, 2009, 11:36:41 am »
Well I already tried this, but no success on this. I get only black box(without my texture)!

so the part of code  is here:


      Texture red = new Texture(8,8, Color.RED);
      TextureManager.getInstance().addTexture("red", red);
      box = Primitives.getBox(10f, 1f);
      box.setTexture("red");
      box.setEnvmapped(Object3D.ENVMAP_ENABLED);
      box.build();


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: how to apply solid color on primitives
« Reply #3 on: June 28, 2009, 12:19:22 pm »
Try in increase the value for ambient light in world. Maybe your scene is just too dark.

Offline sokobozz

  • byte
  • *
  • Posts: 5
    • View Profile
Re: how to apply solid color on primitives
« Reply #4 on: June 29, 2009, 10:38:43 am »
I added more light and it's ok now.
Thanks.