Thread View: comp.sys.sgi.bugs
1 messages
1 total messages
Started by mike
Wed, 30 Dec 1992 01:27
Picking Splines
Author: mike
Date: Wed, 30 Dec 1992 01:27
Date: Wed, 30 Dec 1992 01:27
65 lines
1692 bytes
1692 bytes
We have had trouble picking splines using gselect.
We are using an Indigo XS24 R4000 running IRIX4.0.5F.
Starting with ~4Dgifts/examples/grafix/select1.c we replaced the
call to drawplanet() with the following piece of code.
The picking works fine on the curve hull (drawn with bgnline,endline)
but not with the actual curve (drawn with crv ).
------ cut here -----------------
static Boolean init_basis = TRUE;
short BEZIER_ID = 1;
const float bezier_basis[4][4] = {
{-1.0, 3.0, -3.0, 1.0},
{ 3.0, -6.0, 3.0, 0.0},
{-3.0, 3.0, 0.0, 0.0},
{ 1.0, 0.0, 0.0, 0.0}
};
const float FPS = 30.0;
void drawplanet()
{
float X1 = 200.0;
float Y1 = 200.0;
float X2 = 400.0;
float Y2 = 300.0;
float geom[4][3];
if(init_basis)
{
init_basis = FALSE;
defbasis(BEZIER_ID, bezier_basis);
}
color( 2 );
curvebasis(BEZIER_ID);
curveprecision((short)FPS);
geom[0][2] = geom[1][2] = geom[2][2] = geom[3][2] = 0.0;
geom[0][0] = X1; geom[0][1] = Y1;
geom[1][0] = X1; geom[1][1] = Y2;
geom[2][0] = X2; geom[2][1] = Y1;
geom[3][0] = X2; geom[3][1] = Y2;
crv(geom);
bgnline();
v3f(geom[0]);
v3f(geom[1]);
v3f(geom[2]);
v3f(geom[3]);
endline();
}
----- end cut --------------
Our email address is a bit wonky at the moment so could replies please
be posted to this newsgroup.
Thanks,
Mike Murray
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads