About the orientations attribute of usd pointinstancer

   1344   4   0
User Avatar
Member
14 posts
Joined: 11月 2016
Offline
Hi!I've encountered an issue with pxr usd point instancer, mainly related to the orientations attribute. When the angles between two frames are relatively small, transitioning an object from the SOP level to the LOP level results in the orient attribute values becoming the same. I'm wondering if this is due to a numerical precision limitation in the orientations attribute of pxr usd point instancer.
Thanks!
Edited by ccyzkk - 2023年9月25日 11:51:13
User Avatar
スタッフ
415 posts
Joined: 2月 2008
Offline
Yes, the spec defines the positions attribute as float (point3f), orientations as half float (quath) and scales as float (vec3f) attributes, which can result in precision errors in some cases unfortunately.

According to the schema:

orientations
quath
If authored, per-instance orientation of each instance about the prototype's origin (as defined by application of the prototype's own transformation). Expressed as a half-precision quaternion, since, although we stipulate the quaternion shall be normalized prior to consumption, we expect most clients to be authoring unit or near-unit length quaternions, for which half-precision is more than adequate.


In practice, the float precision for positions tends to be more problematic, i.e: for very large layouts, where breaking up the instancers spatially can help.
User Avatar
Member
14 posts
Joined: 11月 2016
Offline
Hi,npetit!Thanks for replying.
Please take a look this.

orign_orientA = (0.7852686609761677, -0.15321283990986073, -0.21479573393639595, 0.5601265468250699)
orign_orientB = (0.785179235833791, -0.15324712673003482, -0.2147712733408779, 0.5602518950543501)
orign_orientA_to_Quath = Gf.Quath(orign_orientA.w, orign_orientA.x, orign_orientA.y, orign_orientA.z)
orign_orientB_to_Quath = Gf.Quath(orign_orientB.w, orign_orientB.x, orign_orientB.y, orign_orientB.z)
print(orign_orientA_to_Quath,orign_orientB_to_Quath )

(0.785156, -0.153198, -0.214844, 0.560059)
(0.785156, -0.153198, -0.214722, 0.560059)

return values are almost the same, is this correct?
Edited by ccyzkk - 2023年9月26日 23:25:50
User Avatar
スタッフ
415 posts
Joined: 2月 2008
Offline
yes, that looks correct and is expected with half float precision.
User Avatar
Member
14 posts
Joined: 11月 2016
Offline
OK!Thanks npetit!
  • Quick Links