• Blitz Shadow Player
  • Caius
  • redboot
  • Rules
  • Chain of Command
  • Members
  • Supported Ladders & Games
  • Downloads


3D images for unit facing - how does it work?
07-22-2012, 03:12 AM,
#1
3D images for unit facing - how does it work?
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)
Quote this message in a reply
07-22-2012, 03:32 AM,
#2
RE: 3D images for unit facing - how does it work?
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.
Quote this message in a reply
07-24-2012, 01:00 AM,
#3
RE: 3D images for unit facing - how does it work?
(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
Quote this message in a reply
07-24-2012, 07:17 AM,
#4
RE: 3D images for unit facing - how does it work?
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.


Attached Files
.gif   units.gif (Size: 12.85 KB / Downloads: 12)
Quote this message in a reply
07-24-2012, 11:15 AM,
#5
RE: 3D images for unit facing - how does it work?
Warhorse knows a lot about making the images.

What is it you are trying to do?
Quote this message in a reply
07-25-2012, 03:00 AM, (This post was last modified: 07-25-2012, 03:01 AM by Armored Inferno.)
#6
RE: 3D images for unit facing - how does it work?
(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.
Quote this message in a reply


Forum Jump:


Users browsing this thread: 1 Guest(s)