Representing character in FPS

Hi!

I'm trying to represent my character in a first person view.

I don't need to represent weapons and something like that;

I just want to make my character collidable.

So I put a sphere with a boundingbox around the camera, but I don't succeed in making it transparent!

Here's my code:


AlphaState as =display.getRenderer().createAlphaState();
      as.setSrcFunction(AlphaState.SB_SRC_ALPHA);
      as.setDstFunction(AlphaState.DB_ONE_MINUS_SRC_ALPHA);
      Node actorNode = new Node("ActorNode");
      shape = new Sphere("Actor",cam.getLocation(),20,20,10);
      shape.setSolidColor(new ColorRGBA(1,1,1,0));
      shape.setLightCombineMode(LightState.OFF);
      actorNode.attachChild(shape);
      actorNode.setRenderState(lightState);
      wrapper = new BoundingBox();
      shape.setModelBound(wrapper);
      shape.updateModelBound();
      as.setEnabled(true);
      as.setBlendEnabled(true);
      actorNode.setRenderState(as);



Do u see any mistake?
Thank you :)

I believe you need to set the following:


shape.setCullMode(Sphere.CULL_ALWAYS);



That should make the object invisible.

darkfrog

Thank you darkfrog!

But now I can't see textures in the rest of the world :slight_smile:

Maybe I need to update something in the states…

Any suggestion?



Thank you very much  :slight_smile:

It worked that way…

it was a problem of renderer not yet started in that part of the code!

Thanks :slight_smile:

Good job. :wink:



darkfrog