[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Adonthell-artwork] Modeller usage (offset vs. position and size)

From: Kai Sterker
Subject: [Adonthell-artwork] Modeller usage (offset vs. position and size)
Date: Sun, 14 Aug 2011 13:43:56 +0200

I'm about to implement the last bit of the connector feature of
modeller (connectors need to be displayed graphically), when I came
across a "bug" in the model I use for testing. A fix is committed
but I guess an explanation might be helpful.

The problem is that Offset was used instead of setting the correct Z
value for the shape above the doorway opening. While this gave the
appearance that the model was fine, it would have caused strange
effects when placing it on the map.

Individual shapes should always be moved to their proper place using
the Position and Size coordinates. Those determine a shapes location
and extend in 3D space.

Offset OTOH can be used to tweak the final position of the sprite
within the space defined by the shapes. That's why offset is global
and only allows adjustment in 2 dimensions. I am not even sure if an
offset in x direction will ever be needed, but in y direction it could
be required if the height of the sprite is smaller than height + depth
of the model. In that case, one might want to center the sprite in the
model, or align it to the top or bottom (or front or back) of the
model. That's when one would specify an offset in y direction. The NG
sprite is a prominent example where an offset is used.

When using an offset, it is still important that the sprite stays
within the bounds of the shapes, because those act as a clipping
rectangle during rendering, Parts of the sprite that extend beyond the
shape boundaries will most likely be overlapped by other objects and
fail to refresh correctly when something moves in front of them.

And yeah, I guess all that needs to be put onto the Wiki one day.


P.S: Just realised that in case of animations, x and y offset could be
used to properly align the individual frames. So far I assumed that
the individual frame would have to have the same size, but that does
not appear to be necessary..

reply via email to

[Prev in Thread] Current Thread [Next in Thread]