Can I create a 3d line and change the color and thickness?


I think that having a 20 sides cylinder mesh is a bit overkill for a simple gunshot that you barly see anyways.

So I was thinking if I could make a 3d line.

Not draw a line on the gui using worldToScreen sort of method. If I did that, then you will not notice when they go through walls etc.

I want to draw a real line. I could make a simple 2 vertex connected in blender, export and use wireframe as material for it,

but I was hoping theres a more simple way of achiving this…

You are looking for a stretched plane with a billboard function, streched from start to end, and billboarding to the camera for any direction other than the line it follows :wink:

I tried creating a plane and using it as mesh.

But it can only be seen from above. If you look at it from the bottom you will not see it.

Which is weard since Im using debug wireframe and nothing else…

You have to use a billboard control for the plane as far as im concerned.

That’s great!

Only problem is if I search the jme3 wiki for “billboard control” I get nothing.

One page that includes stuff thats in jme3 that Mentions billboard control Once.

Doesn’t provide example or anything else so I stand clueless on what it is and how to use it :confused:

It’s probably just not documented for jME3 yet.

I haven’t done this myself yet w/jME, but have you considered using the particle system for this instead? No idea how it’d turn out for something so fast moving, but it might be a simpler solution. You could probably use it in conjunction with a very small simple (invisible?) prim, which I assume you’d need for collisions. Actually depending on the nature/setting of the game it’d let you come up with much more impressive effects, if you needed.

re: Billboard control… another thing you could do is go to the javadocs and look to see if there is any control called BillboardControl.

However, that being said… I’m not sure it will do what you want. But you could try it.

(controls are just something you add to a spatial… so if you have your node or geometry just call addControl( new BilboardControl() ) or whatever.)

I looked around the net, and billboards are used for objects that should always face a certain direction.

For example a hp bar or name tag of a player should always face your screen.

It’s not really what I need now. I used mesh for the gunshot and it looks great.

But I need to make a 3d grid that can be infinity big.

So when your going to place a model, the model is semi transparent and you can see just how many squares it will take using the grid system.

I found out about the class Arrow, but I didnt find a way to relocate it…

So, you have another problem at hand now? :wink:

If your grid lines do not need to scale with depth you could go with simple GL_Lines, prolly the fasted way to do it as well. You may change the thickness of such a line although it’s depth independent, so 1 pixel thick line would be 1 pixel thick on your screen both on 1 unit distance as well as for a distance from your house to the moon.

Just a word of advice Addez - you probably want to start a new thread for an entirely different problem, you’re more likely to get others (who know the answer) to chime in.