RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Correctly rendering objects

Tissemand

Squire
I seem to be having a small issue when trying to render large/long objects.


Whenever I display an item, I use UltimaSDK to get the image of an item.
When I position it, I find the difference relative to the client's body:
Code:
  // find deltas between self and object
  var dX = (object.x - self.x);
  var dY = (object.y - self.y);
  console.log('{0}: ({1}, {2})'.format(serial, dX, dY));
 
  var x = dX * 22 - dY * 22;
  var y = dY * 22 + dX * 22;
  y -= (object.z || 0);

As a result, I incorrectly get something like this:


instead of:

(the tiles are animated, so the itemids are slightly different)

Anyway, I'm wondering if there's a certain value that affects where an object is placed, or if there's just something I'm missing.
 

Tissemand

Squire
Yup. z just makes it go up (on the negative z).
Here's another example (the ankh gets broken up into parts because of this)

 
Top