home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!darwin.sura.net!dtix!relay!afterlife!adm!amsaa-cleo!neiderer
- From: neiderer@amsaa-seer.brl.mil (Andrew Neiderer )
- Newsgroups: comp.graphics
- Subject: Graphics Gems
- Message-ID: <8242@amsaa-cleo.brl.mil>
- Date: 23 Jul 92 08:43:21 GMT
- Sender: news@amsaa-cleo.brl.mil
- Lines: 21
-
-
- Can anyone tell me why some vector functions, such as
-
- Vector2 *V2Add(a, b, c)
- Vector2 *a, *b, *c;
- {
- c->x = a->x+b->x; c->y = a->y+b->y;
- return(c);
- };
-
- return the pointer to the resultant vector. I would
- just declare it as void since c already contains the
- answer. There must be some advantage to doing it this way.
- I looked throughout the Graphics Gems source code, and
- found that this particular function is used, e.g. as
-
- V2Add(&bezCurve[0],V2Scale(&tHat1, dist),&bezCurve[1]);
-
- Sorry if this appears to be a C question. My reason for
- posting here is to get the attention of some graphics
- programmer who uses this stuff. Thanks.
-