Forums

Full Version: 3D images for unit facing - how does it work?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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)
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.
(07-22-2012, 03:32 AM)junk2drive Wrote: [ -> ]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.

I wasn't able to find answers on the Matrix games website
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.
Warhorse knows a lot about making the images.

What is it you are trying to do?
(07-24-2012, 11:15 AM)junk2drive Wrote: [ -> ]Warhorse knows a lot about making the images.

What is it you are trying to do?

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.