Article View: comp.sys.sgi.bugs
Article #42Picking Splines
From: 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
Technical Details
Message-ID:
<1992Dec30.012730.782@research>Path:
arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!metro!lois!mikeShow Full Headers
Complete Article Headers
Newsgroups: comp.sys.sgi.bugs Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!metro!lois!mike From: mike@research Subject: Picking Splines Message-ID: <1992Dec30.012730.782@research> Organization: Animal Logic Research, Sydney Australia Date: Wed, 30 Dec 1992 01:27:30 GMT Lines: 65