3D images for unit facing - how does it work? - Printable Version +- Forums (https://www.theblitz.club/message_boards) +-- Forum: The Firing Line (https://www.theblitz.club/message_boards/forumdisplay.php?fid=1) +--- Forum: Campaign Series (https://www.theblitz.club/message_boards/forumdisplay.php?fid=8) +--- Thread: 3D images for unit facing - how does it work? (/showthread.php?tid=62336) |
3D images for unit facing - how does it work? - Armored Inferno - 07-22-2012 I always play in 3D mode and the unit facing feature intrigues me from a programming standpoint. The /Specials folder in the West Front directory contains what might be called sprites -- an image file with 6 images in it representing the 6 facings a unit can have in a hex. How does the game engine know how to find the correct image inside the master image of 6? In web development, sprites have fixed X and Y coords within the sprite. Since these campaign series images have varying sizes, that doesn't seem like it could work in a formulaic way (example: if all master images were 20px by 120px, then each mini-image would be 20x20 and very easy to locate programmatically) RE: 3D images for unit facing - how does it work? - junk2drive - 07-22-2012 There is a thread at Matrix with a lot of info about the graphics. I would guess that the program resizes the bmps to a standard and then uses x,y. The standard images are in the main folder of each game, the specials are for snow, early war and late war variants. RE: 3D images for unit facing - how does it work? - Armored Inferno - 07-24-2012 (07-22-2012, 03:32 AM)junk2drive Wrote: There is a thread at Matrix with a lot of info about the graphics. I wasn't able to find answers on the Matrix games website RE: 3D images for unit facing - how does it work? - Armored Inferno - 07-24-2012 Okay, I'm writing C# code in the .Net framework. I figured that I just load the full image into memory, then divide the width by 6 to get the width of one of the 6 facing images, and then use graphics code to "crop" that image. See attached screenshot of the full image and the cropped image. RE: 3D images for unit facing - how does it work? - junk2drive - 07-24-2012 Warhorse knows a lot about making the images. What is it you are trying to do? RE: 3D images for unit facing - how does it work? - Armored Inferno - 07-25-2012 (07-24-2012, 11:15 AM)junk2drive Wrote: Warhorse knows a lot about making the images. I'm writing an MVC website about WWII units and action, just as an exercise with newer .net technologies. I don't have it up on the web yet, but yesterday I created a page that displays the full 6-image image of a unit, then added a 6 hex image you can click on (up, up left, down left, etc...) and it will display the appropriate unit image with the corresponding unit facing. |