iphone - how can i trace the finger movement on touch for drawing smooth curves? -


Like if I want to sharpen my finger on the iPhone screen, then I should do something that is appropriate The curve is made using Quartz 2D or OpenGail.

I want to make a path in the curve style ... I saw that the GL paint is an example (OpenGLus), but it will not help me, if your fingers grow faster. ....

Some are making a smooth curve ..... any kind of example, please tell me

thanks

edit : Moved from the answer given below:

Thanks for everyone .......

But I betge with two control points Trying angular angle but the problem is how to calculate the control points first if there is no predefined number ....

As I mentioned, my movement of finger is fast .... .. So instead of most of the time, I get a straight line curve, due to receiving at least touch points .......

Now it has been said in the form of Mark as comparable, ihad Tried that the first four tu ch Render them on screen, then first remove the point and then go for the next four points east. Phase 1: 1,2,3,4 Phase 2: 2,3,4,5 Such as that approach, I got an overlap, which is not really the issue but it did not get a smooth curve .... ...

But for the fast pace of finger, I have to find something else ?????

Depending on the number of sample points you see, there are two approaches to which I would recommend :

Simple projection

You can sample the finger space only at set intervals and then repeat sample points using something like a spline You can. It sounds easy because you can easily convert a Catmull-Rom spline into a series of curious bazier curves.

, P2 , P2 and P3 , which connects the cubic bezier curve P1 to P2 is defined by the following control points:

  B0 = P1 B1 = P1 + (P2 - P0) / 6b3 = P2 + (P1 - P3) / 6b4 = P2  

It is good enough Work should not be done unless your sample point is very dense and it is super easy. The only problem is your sample Area may be at the beginning and end because the first and last sample point has not been projected into the open curve. A common task-around is to repeat your first and final sample point so that you have enough points for the curve to pass through each of your original specimens.

See Catmooth-Rome Curves, you can try it out.

A curved fit for your sample

will be used to approach a more (more difficult) approach to at least the square of your sample points Let's guess. If you want to try this, then the process looks something like the following:

  1. Collect sample points
  2. Define a Narrative Curve (with its knot vector)
  3. Set up a system of linear equations for samples & amp;
  4. Solve the system in the mean of least squares

Assume that you can choose a proper Norbus knot vector, it will give you a nerves curve Approximate the approximate distance of your sample points, reducing the distance between the samples and your curve. If necessary, the nerve curve may also be decomposed into a series of bejier curves.

If you decide to explore this approach, the book or similar reference would be very useful. In the 5th edition of Farine's book, Section 9.2 deals specifically with this problem. Section 7.8 shows how to do this with a beijing curve, but you probably need a high-degree stage to get a good fit.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -