Can you pick a CatmullRomCurve?

I am using jME 2 to display graphs, not my idea. I have a AbsoluteMouse and the curves are in bounding boxes. I can pick other objects but not the curves. Can CatmullRomCurves be picked? If they can't is there any other way I could display some thing close to the X and Y position of a pick?

hey there,

no, curves can not be picked because they override Geometry.findPick(…) method with an empty implementation.

I guess this is semantically correct, since a curve can not be picked, as it is an abstract mathematical construct, what you would actually pick is the line that is representing the curve visually.

I tested it and if one removes the empty findPick(…) override, you can pick the curve normally (like Line). This goes for BezierCurve and the CRC.

anyone else? should we remove the two empty implementations or keep them?

another thing cyberknight: I would not use the CRC for representing curves, since the actual path of the CRC is kind of not predictable, you might get dips and peaks where they actually shouldnt be. Take a look  at the TrailMesh or Ribbon and connect your points on the graph.

Thanks a lot! I will definitely take a look at TrailMesh and Ribbon. I vote for the picking of the line that represents a BrezierCurve or CRC. I think if you can see it you can pick it. Why would you want to display some thing that you can not pick.


I looked at the TrailMesh demo and couldn't find Ribbon. In the TrailMesh demo the trail kept on disappearing. Is there any way to stop that? To draw the graph would I use the TrailMesh.setTrailFront()? Also did I miss Ribbon in the jME 3 source and javaDoc or is it in jME 2?

P.S.  Why is it the TrailMesh.setTrailFront() needs a time per frame value?

If picking does indeed work correctly (and looking at the code I see no reason it shouldn't), I would say remove them…

cyberknight, you can find the source of the Ribbon class in the forums, it never made it in the jme source.

Yes you can make the Trail permanent so it won't disappear, just start the TestTrailMesh and play around with the parameters (bottom left i guess) until you have the results you want.

basixs: i will make a patch then

Thanks I will mess around with the parameters. Where can I get your patch?


I messed around with the parameters and it did not work. I could draw the curve, but I could not create it. I was not able to make the curve without displaying it. I also tried the Ribbon it worked well, but I did not really like how it was displayed. When the Ribbon neared a 90 degree angle it would start to disappear.

It would be really nice if you could just posted the corrected pick for the CRC curve, Plz!

cyberknight said:

It would be really nice if you could just posted the corrected pick for the CRC curve, Plz!

Thanks for all the suggestions, classes and patches! :slight_smile: