• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

TheMummy

Visibility Tests

4 posts in this topic

Hi 3d coders out there, I have a little problem, with visibility testings. Well I have 6 clipping planes top, bottom, left, right, near and far, defined in this way (i call it the Hesse normal form) o := scalar product N := normal vector of the Plane, has the length of 1.000000 P := Point (vertex) whose visibility is tested A := a Point lying in the Plane sign := is set to make the result poitive when P is visible sign[-/+] * N[x,y,z] o ( P[x,y,z] - A[x,y,z]) = result result is the distance from P to the plane, is positive for every P on the right (visible) side of the plane. And I make this check for every plane. When one of the six results is negative the point is outside the view frustum. Ok, fine so far. BUT when i test the visibility of polygon which is so large or close that the vertices are ALL outside the view frustum, the test says "outside". But the polygon IS visible. So how can I modify this test to avoid these errors? Or should I forget about it , and look for sth else?
0

Share this post


Link to post
Share on other sites
i remember wrestling with this, at a time when i didn't even have the use of vectors.. hehe that was funny
anyway, if you just want to clip your polys for the viewing frustrum, go to http://pages.infinit.net/jstlouis/3dbhole/ and look at this guy's clipping routines, they solve all the problems.
Sorry, just realized the rest of this is screwed up, don't have to read it.
if you just want to determine if the poly is in view or not, try this theoretical idea (i never tried this, just from the top of my head):
define the 4 vectors of your viewing frustrum (from cam through the front plane, will depend on field of view), keep them updated as you move the cam. find just once the correct sum of angles from these four vectors to any vector IN the frustrum, like the one straight in the middle (going from cam out between all four). when your vertex comes in, get the vector from the cam to it and get the four angles from it to the view vectors (dot prod). THEORETICALLY, these four angles should sum up to the defined sum if the vertex is in the frustrum. otherwise, it isn't. if i am wrong in this intiution, u'll be the first one to tell me.
later, Alex

Edited by - AlexM on 1/9/00 6:20:35 PM
0

Share this post


Link to post
Share on other sites
thank you for your reply Alex.
As far as i understood you want to calculate the angles between the vector from cam to the tested vertex and the vector from cam to one of the "viewing vertices". And then add these four angles together. When the result isn't a certain angle the vertex is outside. Yes i believe this works(haven't tested but will try soon) but I think this is not very fast because you would have to calculate four cosh values for every vertex you test. With the Hesse normal form you only have some additions and multiplications.

Well my problem remains , because i want to test if a polygon , in my case a window or portal, is visible or not.


Edited by - TheMummy on 1/10/00 5:24:34 PM
0

Share this post


Link to post
Share on other sites
u didn't have to be that kind.. hehe. well,
you can transform these polys from world to view to projection and just check if its in view or not by clipping against the screen. it's slow. if you need more info on this go to the link, again.
if the portal or window is displayed anyway, you can keep the index of the polys in your projection list and go through it to see if that particular poly is to be displayed, or something like that (better yet, have a flag in ur poly struct and in ur trans and clipping routines write the poly's ID into a special list if the flag is on). ur tests will always be 1 frame late if u display the polys as they come in. if you keep a list of the polys instead, u can do ur test before you send the poly list out to be rendered. it will be very efficient, u do vis tests while the polys are going through the pipeline.
otherwise, i'm working on an alg right now. in a sense, i've done lots of stuff, but i'm still kinda childish in others.

Edited by - AlexM on 1/10/00 6:47:21 PM

Edited by - AlexM on 1/10/00 7:13:13 PM
0

Share this post


Link to post
Share on other sites
First off, might i suggest you use a bounding sphere or box for object culling. This way you can limit the testing of polygons to just those polygonal objects which could actually be found in your frustum.

Second, you should use some form of a polygon-clipping algorithm. The Sutherland-Hodgman clip algorithm can be easily extended to 3D.

From there you should have no problems using your Hesse normal form.

Hope this helps.
0

Share this post


Link to post
Share on other sites