www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/09/19:01:33

From: Chris Holmes <cholmes AT surfsouth DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: 3d
Date: Sun, 08 Aug 1999 16:33:36 -0400
Organization: Georgia Institute of Technology, Atlanta GA, USA
Lines: 40
Message-ID: <37ADE9A0.4060@surfsouth.com>
References: <Oulr3.110$wC DOT 3709 AT stones>
NNTP-Posting-Host: r69h109.res.gatech.edu
Mime-Version: 1.0
X-Trace: news-int.gatech.edu 934150423 20135 128.61.69.109 (8 Aug 1999 22:13:43 GMT)
X-Complaints-To: usenet AT news DOT gatech DOT edu
NNTP-Posting-Date: 8 Aug 1999 22:13:43 GMT
X-Mailer: Mozilla 3.04Gold (Win95; I)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Anthony Graham wrote:
> 
> I've got a 3d world thing working but i don't know to draw the faces in
> order, I've geen getting the vector that is the average (and so the center
> of my polygon (all of them are flat surfaces but the orientation varies))
> and using pythagoras determined the distance of this point from the camera's
> coordinates. After the shapes are drawn in descending distance order. This
> works only on simple shapes. This works fast but i need some more effective
> code which gives the correct order at most times.

  The Z coordinate (or depth into the screen) you should use is not the
average or center point, but by the extreme points.  

> the information available is the 3d coords of camera, and of all the 3d
> coords of each polygon. I've done the un-needed shape removal (off screen
> and back face culling). All i need to do is order the faces. If it makes it
> simpler you don't need to account for intersecting polygons as there will be
> none.

  So you know, "un-needed shape removal" is called HSR or Hidden Surface
Removal.  Back-face culling is a method of HSR.  So is Z-buffering
(which
is something I'm still clueless about).

> given the 3d coords of the flat polygons is there a quick way to see if a
> line (anywhere between 2 3d coords) goes through a 3d polygon? If the way of
> which you know only works for convex polygons (or any other restriction)
> tell me any way.

  I'm working on the math for that right now for something different.
I'll let you know what I come up with.

  Chris

-- 
I know that I will never be politically correct,
and I don't give a damn about my lack of etiquette!
-- Meatloaf


- Raw text -


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