How can I translate child to parent worldspace positions?

Post » Mon Aug 31, 2015 11:00 pm

Hi!

I have trouble with "smaller" worldspaces that have Tamriel as parent. When a char enters one of these child worldspaces, I want to calculate its position relative to the parent worldspace (within a script).

Child worldspaces without a WCTR record (e.g. all mayor cities or Skuldafn) seem to be set in a 'clone' (dimension-wise) of their parent worldspaces, so I can just take the child worldspace position as parent worldspace position. The ones with a WCTR record are those giving me trouble..

After having been fooled by the ONAM records as first, my current theory is that those child worldspaces have dimensions defined by the NAM0 and NAM9 records (SW and NE corners), and are then centered on the cell defined by the WCTR record. If that is correct, what's about the scale-factor in the ONAM record? UESP advised me that the ONAM record is only used for positioning the world marker. But is that also true for the ONAM worldspace scale factor? There are all sorts of scale factors such as 1.0, 2.5, 0.0001 and even 0.0 (!?). My guess was that I first have to translate the x,y and z child worldspace coordinates to the scale of the parent worldspace using the scale factor and afterwards add the offset derived from WCTR, NAM0 and NAM9.

I searched this forum up and down with google, but didn't find anything on that topic. There is a wonderful explanation of worldspace records on the UESP site, but unfortunately it doesn't cover my question.

Any insights are really appreciated.

Granson

User avatar
Jennifer Rose
 
Posts: 3432
Joined: Wed Jan 17, 2007 2:54 pm

Return to V - Skyrim