Newbi: Drawing only the outlines of a box


I searched the forum and looked at the tutorials, but either my problem is too trivial or I am just plain blind  :smiley:

I want to create a simple box simmilar to one used in all the examples but without the inner diagonal edges shown that result from being derived from TriMesh. In the forum I read something about shadows, but I started using jME just a few days ago. My solution in jogl was to do this by defining quads with all the edges by hand but I am sure there is a simpler solution.

This is what I have so far (since the wireframe shows also the diagonal edges I assume this is the wrong approach  :|)

Node boundingNode = new Node("Bounding Node");
WireframeState wireState = display.getRenderer().createWireframeState();
// minVec and maxVec defined at runtime
Box box1 = new Box("Box 1", minVec, maxVec);
box1.setModelBound(new BoundingBox());

Can somebody help me by posting a little piece of code, showing how this is done or pointing out a tutorial (there are many) and indicating where to find it?

Thanks in advance

Maybe you can make it using Line?


first of all: Thanks for the fast reply!

Now: Yes, I could use lines. I just thought there was another (more sophisticated  :D) way of doing it.

So I will use lines. Thank you very much.

Problem is as you said, anything made from a Trismesh tends to contain… triangles. Using Line isn't necisarly the best or most sophiticated solution, but the advantage is, it's rather simple (just add the needed lines to a Node) :slight_smile: They also look nice with anti-aliasing. So unless you have to render quite a lot of these, I'd go with this.

You could also use a CompositeMesh and do something similar to your Jogl solution. (define Quads, or even a quad strip since you only need 4 of the sides in your wire case)