bezier

Get x on Bezier curve given y

早过忘川 提交于 2019-12-02 22:27:34
问题 I have a Bezier curve: (0,0) , (.25,.1) , (.25,1) , and (1,1) . This is graphically seen here: http://cubic-bezier.com/#.25,.1,.25,1 We see on the x axis is time. This is my unknown. This is a unit cell. So I was wondering how can I get x when y is 0.5? Thanks I saw this topic: y coordinate for a given x cubic bezier But it loops, I need to avoid something loops So I found this topic: Cubic bezier curves - get Y for given X But I can't figure out how to solve a cubic polynomial in js :( 回答1:

OpenGL NURBS surface

蓝咒 提交于 2019-12-02 21:06:39
I'm learning OpenGL and I want to get a surface with a slight hump in the middle. I'm currently using this code and im not sure how to adjust the ctrl points to make it the way i want. Its currently like and i would like to have it like this: im not entirely sure what control points i should use and i'm confused on how it works. #include <stdlib.h> #include <GLUT/glut.h> GLfloat ctrlpoints[4][4][3] = { {{-1.5, -1.5, 4.0}, {-0.5, -1.5, 2.0}, {0.5, -1.5, -1.0}, {1.5, -1.5, 2.0}}, {{-1.5, -0.5, 1.0}, {-0.5, -0.5, 3.0}, {0.5, -0.5, 0.0}, {1.5, -0.5, -1.0}}, {{-1.5, 0.5, 4.0}, {-0.5, 0.5, 0.0}, {0

How to find out Y coordinate of specific point in bezier curve in canvas?

依然范特西╮ 提交于 2019-12-02 21:04:13
I need to find out Y coordinate of specific point of bezier curve in canvas. Do you know, how to find it out? Thank you Using de Casteljau's algorithm you can find the coordinates x and y of a bezier curve for any t, the percentage or interpolation step. So a t of .1 would give you the x and y at 10% of the curve from the beginning. A t of .9 would be 90% from the beginning, and so on. In our cubic bezier we have p0 (point 0), cp0 (control point 0), cp1 (control point 1), and p1 (point 1). In the first step of the algorithm we draw a line connecting p0 and cp0, another line connecting cp0 and

Android: digital signature using Bezier

随声附和 提交于 2019-12-02 20:35:20
I am trying two draw digital signature using Bezier as show in above image.when i touch and try to draw line then the result is dot line but not getting continuous line. Simple signature done by using simple signature but I want to create more a smooth curve using Bezier with touch pressure. tried with this link SignatureViewDemo.java public class SignatureViewDemo extends View { private int color = Color.BLACK; private Bitmap m_Bitmap; private final Paint m_BorderPaint; private Canvas m_Canvas; private Point m_CropBotRight; private Point m_CropTopLeft; private float m_CurrentX; private float

Extrapolate split cubic-bezier to 1,1

谁说胖子不能爱 提交于 2019-12-02 19:14:58
问题 I need help with the solution provided here. Create easy function 40% off set I need to modify it so that the returned left and rights are extrapolated to 1,1 after splitting. This is because if I don't extrapolate, I can't use the returned split cubic-bezier as a css transition. So this is the test I did. Please help because real does not match mike way :( I think the issue is I need to extrapolate the result to 1,1. I can't simply double the values though I'm pretty sure. REAL ease-in-out

Move an object on on a Bézier curve path

喜你入骨 提交于 2019-12-02 16:01:14
I want to move my image on a Bézier curve path from top to bottom but I can't get how can I calculate x/y points and slope from this path. The path looks like the following image: I have start points, end points and two control points. Path path = new Path(); Point s = new Point(150, 5); Point cp1 = new Point(140, 125); Point cp2 = new Point(145, 150); Point e = new Point(200, 250); path.moveTo(s.x, s.y); path.cubicTo(cp1.x, cp1.y, cp2.x, cp2.y, e.x, e.y); This is a cubic Bézier curve for which the formula is simply [x,y]=(1–t)^3*P0+3(1–t)^2*t*P1+3(1–t)t^2*P2+t^3*P3 . With this you can solve

Get x on Bezier curve given y

喜你入骨 提交于 2019-12-02 10:38:25
I have a Bezier curve: (0,0) , (.25,.1) , (.25,1) , and (1,1) . This is graphically seen here: http://cubic-bezier.com/#.25,.1,.25,1 We see on the x axis is time. This is my unknown. This is a unit cell. So I was wondering how can I get x when y is 0.5? Thanks I saw this topic: y coordinate for a given x cubic bezier But it loops, I need to avoid something loops So I found this topic: Cubic bezier curves - get Y for given X But I can't figure out how to solve a cubic polynomial in js :( This is mathematically impossible unless you can guarantee that there will only be one y value per x value,

Extrapolate split cubic-bezier to 1,1

房东的猫 提交于 2019-12-02 10:17:33
I need help with the solution provided here. Create easy function 40% off set I need to modify it so that the returned left and rights are extrapolated to 1,1 after splitting. This is because if I don't extrapolate, I can't use the returned split cubic-bezier as a css transition. So this is the test I did. Please help because real does not match mike way :( I think the issue is I need to extrapolate the result to 1,1. I can't simply double the values though I'm pretty sure. REAL ease-in-out is cubic-bezier(.42,0,.58,1) and graphically is http://cubic-bezier.com/#.42,0,.58,1 first half is ease

Drawing arc with bezier curves

巧了我就是萌 提交于 2019-12-02 09:28:29
问题 I am trying to draw an arc using bezier curves. I have learned that you can't draw a perfect circle using bezier curves but you can come close. Unfortunately the math is too complicated and I can't personally figure it out. I can create the A1 slice below as a triangle, but I can't figure out how to determine the control points. Also if I try drawing a slice out of a circle in the opposite direction, notice how the control points seem to point in the negative direction. So if I want a slice

Smooth Hilbert curves

。_饼干妹妹 提交于 2019-12-02 08:49:42
问题 I'm trying to smooth out the path taken by a Hilbert curve. I can define the points and connect them by straight lines, but I want a path that doesn't take the edges so sharply. I attempted to connect the curve using Bezier curves of higher and higher orders but this doesn't work, there are always 'kinks' in the path as I try to reconnect them: I feel like this a solved problem, but I'm not searching for the right terms. 回答1: How about using piecewise cubics for this... Does not really matter