Effect similar to .show() on collision rays [SOLVED]

I like the effect I get when I call .show() on the nodepath holding the collision ray I use for targeting. It looks like a laser range finder, and I want to use it to construct a firing guide for the player. However, I’d rather it were colored, instead of white. I tried setting the color of the node, but that didn’t work. Also, I obviously don’t need it to be a collision object.

Is there another way I can simulate this kind of effect?

You can use the LineSegs class to create your own one-pixel lines directly, and these you can set to whatever color you like.

David

Alright, thanks.

I ended up using a model made from 2 point polys to create the effect I’m looking for.

I’m curious, though. Is there a way to set the thickness of 2 point polys generated this way? Like the LineSegs.setThickness() method?

Nevermind. I just saw that you can use setRenderModeThickness() on the node path in the manual.

The vanishing line is not because of varying thickness, but simply alpha ramp.

LS=LineSegs()
LS.moveTo(0,0,0)
LS.setColor(1,1,1,0)
LS.drawTo(1,0,0)
aspect2d.attachNewNode(LS.create()).setTransparency(1)

That I am aware of. Combining Alpha with Glow doesn’t work, though. Given the choice between the two, the glow works better for my purposes. Thanks, though.