Simple texcoord variant?
Posted: Mon Jan 04, 2010 9:15 pm
I have a very simple problem to solve, but to do so seems to involve so much hair that I can't believe that there isn't a better way.
I've used texcoords, for instance to put an image on a sign. I have something very simple I'd like to do, but the texcoord machinery might be annoyingly ponderous to use for it. Basically, I've got textures that represent one story of a building, e.g. a row of windows. Right now I create meshblocks with these as the textures, and it looks OK, but often half of a story is cut off at the top of the block. What I want is to be able to guarantee that *an integer number* of these textures is tiled vertically, so that the building has (say) 12 stories or 13 stories, not 12.75. And I don't care if the integer number is 12, 13, 7, or 19; I only care that it be an integer.
To use the texcoord machinery I'd have to worry about the horizontal tiling as well (I don't care about corner wrap), so as not to change aspect ratio. The only way I can see to do this now is to compute a complete mapping (texcoord layout) for the entire block, which while doable just gives me a headache thinking about, since it provides near zero value.
Ideally, I suppose, bzfs would allow some sort of "integer tiling" option for a mesh in a given dimension.
Without that, I could build each building out of individual stories, as groups, put one on top of the other. This might be slightly less tedious (I'd only have to work out the texcoords for one story), but the aspect ratio/horizontal texcoord layout problem still shows up.
Alternatively, if I could get bzfs to tell me what it will do with a given texture, I could adjust the block height so that an integer number of tiles would result. I don't know how to do this - right now I'd just experiment with different building heights, but I have no reason to assume that what works on my machine/video card/video settings/BZFlag settings would look the same to someone else.
This seems such a basic and possibly widespread problem that maybe someone either has a good solution at hand, or an approach I should know about. Help! Help? Thx.
I've used texcoords, for instance to put an image on a sign. I have something very simple I'd like to do, but the texcoord machinery might be annoyingly ponderous to use for it. Basically, I've got textures that represent one story of a building, e.g. a row of windows. Right now I create meshblocks with these as the textures, and it looks OK, but often half of a story is cut off at the top of the block. What I want is to be able to guarantee that *an integer number* of these textures is tiled vertically, so that the building has (say) 12 stories or 13 stories, not 12.75. And I don't care if the integer number is 12, 13, 7, or 19; I only care that it be an integer.
To use the texcoord machinery I'd have to worry about the horizontal tiling as well (I don't care about corner wrap), so as not to change aspect ratio. The only way I can see to do this now is to compute a complete mapping (texcoord layout) for the entire block, which while doable just gives me a headache thinking about, since it provides near zero value.
Ideally, I suppose, bzfs would allow some sort of "integer tiling" option for a mesh in a given dimension.
Without that, I could build each building out of individual stories, as groups, put one on top of the other. This might be slightly less tedious (I'd only have to work out the texcoords for one story), but the aspect ratio/horizontal texcoord layout problem still shows up.
Alternatively, if I could get bzfs to tell me what it will do with a given texture, I could adjust the block height so that an integer number of tiles would result. I don't know how to do this - right now I'd just experiment with different building heights, but I have no reason to assume that what works on my machine/video card/video settings/BZFlag settings would look the same to someone else.
This seems such a basic and possibly widespread problem that maybe someone either has a good solution at hand, or an approach I should know about. Help! Help? Thx.