Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

## alleg-main

 RE: [AL] 3D questions and problems From: Philip M. Galea - 1998-05-24 14:32:04 Attachments: Message as HTML ```1. Pass 2. Depends on how you're "preparing" the scene. I just "zsort" all the polygons (using all the vertices) and just draw = the furthest away ones first (but culling the backfacing ones). =20 If I can assume your flat planes are made up of smaller regularly sized = "tiles" (basically a quad in Allegro) like a grid in a way, then a wall = will be more or less straight up an down i.e. perpendicular to your = planes. Using this method generally always work as all the walls z = coords will be closer than the planes. Another good point is it's dead = easy to implement and is quick. A 2x2 plane (view from above) =20 + are vertices - an edge =3D wall z ^ +-----+-----+ |TILE |TILE | | | | +-----+=3D=3D=3D=3D=3D+ |TILE |TILE | | | | +-----+-----+ >x =20 (view from front) y ^ +=3D=3D=3D=3D=3D+ =3DWALL=3D=3D =3D=3D=3D=3D=3D=3D=3D +-----+=3D=3D=3D=3D=3D+ >x Another method would be to use BSP but I still don't understand how it = works when the view point is moving to explain it. Philip M. Galea=09 http://www.cee.hw.ac.uk/~ceepmg -----Original Message----- From: Nick Kochakian [SMTP:NickK@...] Sent: 24 May 1998 01:45 To: allegro@... Subject: [AL] 3D questions and problems 1 - say I have a flat plane somewhere in my 3D space. How'd I make sure that the camera dosen't walk inside that plane? 2 - Here's a tougher one: Let's say I have a bunch of flat planes and = walls that are all over the 3D world... How'd I make sure the walls are drawn over the planes, and the planes not drawn over the walls? Thanks to all thoes who can answer any of the question(s)! :) ```
 Re: [AL] 3D questions and problems From: Nick Kochakian - 1998-05-24 17:38:59 ``` ---------- From: Philip M. Galea To: 'allegro@...' Subject: RE: [AL] 3D questions and problems Date: Sunday, May 24, 1998 7:24 AM 1. Pass 2. Depends on how you're "preparing" the scene. I just "zsort" all the polygons (using all the vertices) and just draw the furthest away ones first (but culling the backfacing ones). If I can assume your flat planes are made up of smaller regularly sized "tiles" (basically a quad in Allegro) like a grid in a way, then a wall will be more or less straight up an down i.e. perpendicular to your planes. Using this method generally always work as all the walls z coords will be closer than the planes. Another good point is it's dead easy to implement and is quick. Ok, here's how I do it: start tile -> XXXXXXXXX XW X XXXXXXXXX <- end tile (scans left to right) ```
 Re: [AL] 3D questions and problems From: - 1998-05-24 17:52:07 ```>1 - say I have a flat plane somewhere in my 3D space. How'd I make sure >that the camera dosen't walk inside that plane? I think the starting point would be to work out which side of the plane the camera is on. If you have the equation that defines the plane in the form ax+by+cz+d then putting a point into the equation that is on the plane will give 0, but all points on one side of the plane will give a positive value, and all points on the other would give a negative value. So, you could put a point into the equation that you no is on the wrong side of the plane and store the sign of the result. Then, you could put the position of the camera into the equation. If the sign of the result is the same as the first test, then you know that the camera is on the wrong side of the plane, and whatever move took the camera there shouldn't be allowed. I hope that's at least of some use :-) -- --------------------------------------------------------------- Andrew Eland Software Engineering Year 1 Student mailto:ace97@... Imperial College, London http://www.geocities.com/SunsetStrip/Studio/9550/andysPage.html "J'irai chercher ton coeur si tu l'emportes ailleurs" Pour Que Tu M'Aimes Encore, Celine Dion ```