delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/31/07:00:50

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: I need to find the center of a triangle in 3D space, help!
Date: Sat, 31 Jan 1998 09:28:30 +0000
Organization: None
Distribution: world
Message-ID: <vbm4CWA+6u00Ewtl@talula.demon.co.uk>
References: <6au3is$6lk$1 AT newton DOT leba DOT net>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 27
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Ted Gress writes:
>Does anyone know how to find the center point of a triangle from the
>coordinates of 3 vertices?? 

The "center" of a 3d object is not a very well defined concept, but for
most purposes just averaging the three vertices would do the trick.

>And does anybody know the formula (without matrices! !yikes!) to rotate
an object around a specific point?

Translate it to the origin, rotate it around the origin, and then
translate back to the original position.

But why do you say "without matrices"? IMHO matrices are the only
sensible way to do something like this, because they provide an easy way
to concatenate the translations and rotation into a single transform
rather than having to do each operation as a separate step. They aren't
nearly as complicated as they seem when you first look at them, and can
make your code far more robust, flexible, and efficient.

btw. this sort of question is not appropriate for a djgpp newsgroup:
comp.graphics.algorithms would be a much better place to ask.


--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
"Pigs use it for a tambourine" - Frank Zappa

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019