Your right! Just get the segments end do a line intersection (I have used funcs like this for other things) However its a little tricky for this resion.wavk wrote:broken wrote:Wavk, where are you? Wavk must have figured it out somehow when he made crafter - hopefully he should may be able to shed some light on the subject...ideasman wrote:Now I have added curved spline segments its going to be tricky to work out if the users mouse is over it.
(Well I dont know how to at least)
Hi guys! Nice to see people working on this. It's turning out a lot like crafter Just the way I like it.
I'm in Spainbroken wrote:Wavk, where are you?
To see if a user's mouse is over a connection.... It's not as difficult as you might think it will be. I had to think over it too.
I guess you do know how to detect the mouse over a single line? The curve is basicly a number of lines. So what you have to do is do the same thing for every segment of the curve.
The way I did the line removal in crafter is basicly calculating if the line the user draws intersects with on of the lines in the curve, which is very basic math.
This is a VERY interesting discussion and I've been also thinking about the OOPS window. When I'm back home, I'll join the discussion
The spline rendering code user a GL function that creates the segments using an iterating loop-
glMap1f(GL_MAP1_VERTEX_3, 0.0f, (float)segNum, 3, 4,&ctrlPoints);
All the spline rendering is done in GL, so one of 2 things have to be done.
Catch the glMap1f call and find out what coords its calling.
Use a function that mimics glMap1f so the coords can be calculated.
The latter is a bit cruddy since the same calculation is being done twice and Id have to include a spline rendering functuion.
How did you go about it wavk?