nurbs

How to draw absolutely custom shape in Java?

只愿长相守 提交于 2019-12-07 18:23:50
问题 The most complex shape, supported by Java2D API is a Bezier segment. Suppose I want to draw rational segment (each control point has a weight and the entire rendering formula is slightly different). How to accomplish that? Is it possible to extend rendering engine to be able to draw more complex shapes? UPDATE Usual way to implement custom shape is implementing Shape interface. This interface has key methods to return PathIterator while PathIterator iterates over segment types. There are only

How to create a cubic bezier curve when given N points in 3D?

試著忘記壹切 提交于 2019-12-03 08:29:40
So I need to find out where the control points would be for a cubic bezier curve when only knowing points on the curve, the points can lie in 3D. It would be ideal if I could do this for any number of points on the curve. Most of what I have found deals only with 2D, or only for 4 points. Let me see if I understand you: you want an interpolating Bezier curve, going through a given set of points P0 P1 ... but drawn as Bezier curves, with a function like bezier4( nstep, Pj, Cj, Dj, Pj+1 ) -- control points Cj, Dj That is, you want to derive two Bezier control points Cj, Dj for each piece Pj --

OpenGL NURBS surface

主宰稳场 提交于 2019-12-03 07:40:12
问题 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,

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