Skip to main content
GameDev.net gamedev.net
🔒 Locked

Help on Math problems

Started by cloudsaber Aug 28, 2006 at 10:04 PM 3 replies 800+ views
Original Post
cloudsaber
cloudsaber
Hi all, I'm a newcomer to this forum, I recently are playing with L-systems to create a top-down view of wall texture map generating interesting shapes using opengl and c++. Suppose I want to create an exterior wall texture and interior wall texture layout kind of those like in game maps, what algorithms can I use to distinguish the "interior" wall texture from its boundary texture regardless of the power multiplication and different boundary shapes layout? The reason for this is so that i can draw a different texture for the interior and another different texture to the exterior wall. Previously, i tried to use rotation angles to detect them but i think is not efficient for any type of string shapes I want to develop. The definition of "interior" in this case would be there are boundary textures around it. Any advice would be appreciated. Thanks
PhilMorton
PhilMorton
I would name your topic "Need help detecting interior and exterior walls" (or something like that) instead of "Help on Math problems".

The fact that you're posting in the math forum tells us that you need help with a math problem allready; your topic should be a description of the problem.

Your question isnt worded very well, so im not exactly sure what you mean...

Do you just need to find a way of telling you if a wall should use an "interior" or "exterior" texture?

Are these walls generated automatically by some algorithm, or do you make these walls with an art package?
Allways question authority......unless you're on GameDev.net, then it will hurt your rating very badly so just shut the fuck up.
cloudsaber
cloudsaber
Sry for the topic title,

Actually in my previous post I'm using a L-systems to procedurally generate textures in my window display screen. I put my camera to view this textures sort of from top-down view. kinda of when you're looking on a game maze map. My problems are during procedurally generating these textures , there are "walls" which I called "interior" that I want to distinguish from its boundary walls so I can "draw/paint" it in another texture colour. So the question is, is there any algorithm or mechanism to tell me that the wall should use an "exterior" or "interior" texture?

edit: what forum area should i post this topic into ?
TheAdmiral
TheAdmiral
If it still isn't clear what cloudsaber is getting at, here's my take (please correct me if I'm wrong):

An L-system has created a 2D map out of potentially intersecting lines/walls (right?). Each side of each wall needs to be textured/painted according to its 'exposure': If the wall surface faces an area that is entirely enclosed (by itself an other walls) then this wall surface is considered interior. If not, or equivalently if there exists a connected path from this wall-face to the map boundary that doesn't intersect any walls, then it is exterior.

If I have the right idea, then you'll probably want to tell us more about how your map is being stored: If it is as a pixel buffer, then you may want to look up 'flood-fill algorithms'. Otherwise, you have a pathfinding problem, and we'll need more details to suggest a good solution.

Tell us more.
Admiral
Ring3 Circus - Diary of a programmer, journal of a hacker.
cloudsaber
cloudsaber
I think TheAdmiral has almost identified my problems but I have some advanced requirements for that. Currently all my Textures are stored as pixel buffers without knowing their own coordinates. So everytime my L-systems is exploded, I can get irregular different kinds of boundary area that is entirely closed around the wall texture itself that I would want to declare as "interior" textures. Exterior textures also would be like TheAdmiral just said but to refine these two requirements, is it possible for those intersecting lines/walls I can texture part of it as interior and another part as exterior?

Here are some of the screenshots to explain better my problems

Initial L-system generated shape
http://img123.imageshack.us/my.php?image=lmathproblems1vn8.png


Exploded version of L-system generated shape

http://img123.imageshack.us/my.php?image=lmathproblems2jz8.png

[Edited by - cloudsaber on September 19, 2006 1:51:28 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.