Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / 3D Hexagon Texturing

Author
Message
Whisper Wind
22
Years of Service
User Offline
Joined: 5th Apr 2003
Location:
Posted: 6th Apr 2005 15:54 Edited at: 6th Apr 2005 16:05
I have decided that I want to make a hexagon tile based and turn based combat engine for my game. Now, I wanted to include height (stacked hexagon tiles), so since db pro comes with a 3D engine, i thought it would be much easier doing it in the 3D engine. However, before I start I'm worried about some possible problems:

1. Getting textures to tile on the hexagons. Now, for example if wanted to make a patch of grass hexagons together, I want the grass hexagons to have a grass texture that tiles seamlessly. Textures only come in rectangle shapes, not hexagonal ones (obviously ). How can I dynamically texture the hexagon models so that I can in a sense take a larger (or smaller, whatever) texture and lay it over the tops of multiple hexagons so it is seamless, and it looks decent.

2. Getting textures to transition. If I am going with a system described above, how would I make it so that terrain types fade semalessly together? I could just make transition textures if it weren't for the fact that the larger texture I'm laying over the hexagon parts could stop at any place in the image. Am I going to have to dynamically create textures with alpha channels, etc... in the game (or at least map editor)? How easy/feasible is this? Any good suggestions for this? If this is too hard to do I could cut this with somewhat-minimal drawbacks visually (the edge of hexagon could work ok as a transition between textures).

3. In the editor I'm going to definately want to apply textures to different sides of blank hexagons (they are 3D, so they have sides). Would this mean effectively having the editor create and then save a different texture for each hexagon (just one image wrapping around entire hexagon that can texture it), which could then be applied in game? Is it better to dynmacially create these textures in-game from the map data?

I'm so confused.... Basically what I am shooting for is a system where you can paint textures on the sides of hexagons, the textures are actually overlays so they don't look bad, and that there is a system of fading in these overlays. Looks more complex then I actually thought. Anyone have any ideas/suggestions/comments on how I should go about implementing this stuff? I would greatly appreciate it if someone explained to me how best to do this (am I going at it all wrong?), and how exactly (or conceptually) I'm going to get textures and models and dbp to all interact and play nice. Thanks in advance!

Searching for file 'sanity'...
Sorry, no results were found.
Daveh
20
Years of Service
User Offline
Joined: 30th Mar 2005
Location:
Posted: 6th Apr 2005 22:45
Some of this definitely is rather involved...

1. Getting a texture to span multiple hexagons is relatively straight forward. Say you have 4 hexagons in a row you want to texture with a single image. All you have to do is set the U coordinates of the first hexagon from 0-0.25, the 2nd from 0.25-0.5, 3rd 0.5-0.75 and 4th 0.75 to 1.0. You can similarily do the same thing with the V texture coordinate. If you wanted to end the texture in the middle of the 4th hexagon the U value would be: 0, 0.28, 0.56, 0.84, 1.12 (roughly). The SCALE OBJECT TEXTURE command is useful here.

2. I know this is possible in DB but I'm not sure how its done.

3. If your hexagon is a single object, you can texture all sides of the object with the same image. You cannot easily use one image for the top and another for the sides (if that was what you were intending). You can specify the UV coordinates for each vertex in the object so you can basically tile the texture any way you want on each side.
Whisper Wind
22
Years of Service
User Offline
Joined: 5th Apr 2003
Location:
Posted: 8th Apr 2005 15:50
Thanks for your reply I'll have to think this one out some more!

Searching for file 'sanity'...
Sorry, no results were found.
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 9th Apr 2005 00:23
Some images that might help you design the hex map. Mission Force: Cyberstorm is an old (1996) game by Sierra, still one of my favorites.

http://www.gamespot.com/pc/strategy/missionforcecyberstorm/screenindex.html
--
TAZ

"Do you think it is wise to provoke him?" "It's what I do." -- Stargate SG-1

Login to post a reply

Server time is: 2025-06-06 10:59:29
Your offset time is: 2025-06-06 10:59:29