| 25 | | |
| 26 | | |
| 27 | | |
| 28 | | |
| 29 | | |
| 30 | | -----Original Message----- |
| 31 | | From: ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu> |
| 32 | | Sent: Wednesday, September 11, 2024 2:35 PM |
| 33 | | To: Browne, Kristen (NIH/NIAID) [C] <kristen.browne@nih.gov>; goddard@cgl.ucsf.edu |
| 34 | | Cc: gregc@cgl.ucsf.edu |
| 35 | | Subject: [EXTERNAL] Re: [ChimeraX] #15899: WRL vs. GLB output |
| 36 | | |
| 37 | | |
| 38 | | |
| 39 | | #15899: WRL vs. GLB output |
| 40 | | |
| 41 | | ---------------------------------------+------------------------- |
| 42 | | |
| 43 | | Reporter: kristen.browne@…<mailto:kristen.browne@…> | Owner: Tom Goddard |
| 44 | | |
| 45 | | Type: defect | Status: assigned |
| 46 | | |
| 47 | | Priority: normal | Milestone: |
| 48 | | |
| 49 | | Component: Input/Output | Version: |
| 50 | | |
| 51 | | Resolution: | Keywords: |
| 52 | | |
| 53 | | Blocked By: | Blocking: |
| 54 | | |
| 55 | | Notify when closed: | Platform: all |
| 56 | | |
| 57 | | Project: ChimeraX | |
| 58 | | |
| 59 | | ---------------------------------------+------------------------- |
| 60 | | |
| 61 | | Comment (by Tom Goddard): |
| 62 | | |
| 63 | | |
| 64 | | |
| 65 | | Hi Kristen, |
| 66 | | |
| 67 | | |
| 68 | | |
| 69 | | Thanks for your immense patience explaining this to me! I think I get it now. Let me try explaining the way I understand it and if I have it right we can come up with a solution. |
| 70 | | |
| 71 | | |
| 72 | | |
| 73 | | You have a scene in a GLTF file that is a tree of nodes. Each node can have a transformation matrix, for instance, in the current ChimeraX GLTF the top centering node has a translation so that the bounding box of the entire scene is centered at 0,0,0 in the world coordinates. Let's imagine my scene has two atomic models that are a ways apart from each other. I might want to rotate one of those two atomic models in the scene about its center. So in Blender I could click on its node and rotate it. But that works poorly now because Blender takes the pivot for rotation at 0,0,0 in the local coordinates of that node. That atomic model came from crystallography and its bounding box is far away from 0,0,0. So it ends up rotating around a point far from the center of the atomic model which is bad. It surprises me quite a bit that Blender and other 3D scene software would work that way. I would expect it to rotate not about 0,0,0 in the node local coordinates. I would expect it by default to rotate about the center of the bounding box of the node. Since it doesn't work that way the tree of nodes ideally should be created so that for every node its bounding box is centered at 0,0,0 in the local coordinates of that node. The node can then have a transformation on it that places the node in the correct position within its parent node. This is a restrictive constraint on how the transformations of all the nodes are set to maintain this property that every node has its geometry centered at |
| 74 | | |
| 75 | | 0,0,0 in the node's local coordinate system. |
| 76 | | |
| 77 | | |
| 78 | | |
| 79 | | ChimeraX and molecular data in general is not restricted in that way. But I see that any node hierarchy can have its transformations replaced and vertex buffers shifted to have that property. Basically it amounts to going to the bottom of the tree where there are vertex buffers, shifting them to center them, and then undoing the shift using the transform in the node that references those buffers. And you just walk from the leaves of the tree up to the root modifying the transformations all the way to the top node doing the same trick, shift all the child nodes of a parent so the parent is centered at 0,0,0 and then reposition the parent using its transform so it maintains its original position in the scene. The end result is every node is centered at 0,0,0 in its local coordinates and the scene looks identical, you just juggled the positioning transformations between child nodes and parent nodes. |
| 80 | | |
| 81 | | |
| 82 | | |
| 83 | | I've never had to work with a restrictive scene graph rule like this. But from what you say it is the norm that 3D graphics software like Blender and C4D rely on this assumption and if it is violated the user interface in those programs becomes very challenging to use. |
| 84 | | |
| 85 | | |
| 86 | | |
| 87 | | If I understand the situation correctly I can see if I can do the transformation propagation from vertex buffers up the tree to make a more usable GLTF file. One casualty of that is that you lose the original crystallographic coordinates for say an x-ray atomic model node. The node no longer has those coordinates and you only know where it is in the overall scene. But for use of these GLTF files where knowing the original source data coordinates is not likely to be important, that is no loss. |
| 88 | | |
| 89 | | |
| 90 | | |
| 91 | | Tom |
| 92 | | |
| 93 | | -- |
| 94 | | |
| 95 | | Ticket URL: <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.rbvi.ucsf.edu%2Ftrac%2FChimeraX%2Fticket%2F15899%23comment%3A18&data=05%7C02%7Ckristen.browne%40nih.gov%7C5978dce96456443722c008dcd2906537%7C14b77578977342d58507251ca2dc2b06%7C0%7C0%7C638616764816772467%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=bboKexpOOFNgtW6qiplzolBWDbqzqoBEZqV%2FR4RWvvE%3D&reserved=0<https://www.rbvi.ucsf.edu/trac/ChimeraX/ticket/15899#comment:18>> |
| 96 | | |
| 97 | | ChimeraX <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.rbvi.ucsf.edu%2Fchimerax%2F&data=05%7C02%7Ckristen.browne%40nih.gov%7C5978dce96456443722c008dcd2906537%7C14b77578977342d58507251ca2dc2b06%7C0%7C0%7C638616764816784326%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=7bpyAMR%2FHccYNApPlf9ldia8h5bEO%2BSMJCk2xABxV5s%3D&reserved=0<https://www.rbvi.ucsf.edu/chimerax/>> |
| 98 | | |
| 99 | | ChimeraX Issue Tracker |
| 100 | | |
| 101 | | CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and are confident the content is safe. |
| 102 | | }}} |
| 103 | | |