| 369 | | |
| 370 | | -----Original Message----- |
| 371 | | From: ChimeraX <ChimeraX-bugs-admin@cgl.ucsf.edu> |
| 372 | | Sent: Tuesday, September 10, 2024 6:02 PM |
| 373 | | To: goddard@cgl.ucsf.edu; Browne, Kristen (NIH/NIAID) [C] <kristen.browne@nih.gov> |
| 374 | | Cc: gregc@cgl.ucsf.edu |
| 375 | | Subject: [EXTERNAL] Re: [ChimeraX] #15899: WRL vs. GLB output |
| 376 | | |
| 377 | | |
| 378 | | |
| 379 | | #15899: WRL vs. GLB output |
| 380 | | |
| 381 | | ---------------------------------------+------------------------- |
| 382 | | |
| 383 | | Reporter: kristen.browne@...<mailto:kristen.browne@...> | Owner: Tom Goddard |
| 384 | | |
| 385 | | Type: defect | Status: assigned |
| 386 | | |
| 387 | | Priority: normal | Milestone: |
| 388 | | |
| 389 | | Component: Input/Output | Version: |
| 390 | | |
| 391 | | Resolution: | Keywords: |
| 392 | | |
| 393 | | Blocked By: | Blocking: |
| 394 | | |
| 395 | | Notify when closed: | Platform: all |
| 396 | | |
| 397 | | Project: ChimeraX | |
| 398 | | |
| 399 | | ---------------------------------------+------------------------- |
| 400 | | |
| 401 | | Comment (by Tom Goddard): |
| 402 | | |
| 403 | | |
| 404 | | |
| 405 | | Hi Kristen, |
| 406 | | |
| 407 | | |
| 408 | | |
| 409 | | The BabylonJS __root__ node has a 180 degree rotation about y and flips z -> -z. I guess that is because the BabylonJS coordinate system does not match the standard GLTF coordinate system (x axis horizontal pointing right, y axis vertical pointing up, z axis pointing out of the screen toward you to make right handed coordinate system). So BabylonJS adds a __root__ node in order to convert the GLTF coordinate system to the BabylonJS coordinate system. The ChimeraX coordinate system is the same as GLTF. The BabylonJS __root__ node seems to work correctly since the orientation of the scene shown in BabylonJS matches the orientation shown in ChimeraX. From what I read online Blender has the y-axis pointing into the screen and the z-axis pointing vertically in the plane of the screen, so it is rotated 90 degrees about x relative to the GLTF and ChimeraX coordinate systems. |
| 410 | | |
| 411 | | |
| 412 | | |
| 413 | | https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fen.wikibooks.org%2Fwiki%2FBlender_3D%3A_Noob_to_Pro%2FUnderstanding_Coordinates&data=05%7C02%7Ckristen.browne%40nih.gov%7Cdbb5cc2280014feb7a0a08dcd1e44476%7C14b77578977342d58507251ca2dc2b06%7C0%7C0%7C638616025531189236%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=TDsbJe%2FU596mpfk6HOiU6r7EBz2MbAK7z%2FV4hJzjUrg%3D&reserved=0<https://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Understanding_Coordinates> |
| 414 | | |
| 415 | | |
| 416 | | |
| 417 | | In the .glb output from ChimeraX the centering is to put (0,0,0) at the center of the bounding box. Why do you say the origin should be at the "center of mass"? What do you mean by mass? Each triangle has weight proportional to area? Or the enclosed volume of uniform mass? Do you really want a center of mass origin instead of center of bounding box? |
| 418 | | |
| 419 | | |
| 420 | | |
| 421 | | Everything I see in BabylonJS with the ChimeraX .glb looks correct. |
| 422 | | |
| 423 | | BabylonJS puts the camera target at (0,0,0) now that I got rid of the unused vertices that were throwing BabylonJS box calculation off. That is exactly what centering is intended to do. The centering node matrix shifts the children objects by (-160, -104, -165). That is the amount of shift, not the origin. The center of the bounding box of the surface without the centering node is (160, 104, 165) (without the negative signs) and the centering matrix shifts in the negative direction so that the surface center has coordinates 0,0,0 in the centering node coordinate system. |
| 424 | | |
| 425 | | |
| 426 | | |
| 427 | | So everything looks exactly as it should be in BabylonJS, the ChimeraX .glb appears correct and is being interpreted correctly by BabylongJS (except it mishandles unused vertices including them in the bounding box calculation). I'm embarrassed to keep saying this, I don't understand what problem you think the ChimeraX centered .glb has. I don't see any center of rotation issues in BabylonJS with this file. Perhaps you mean that if you strip away the centering node and work with the child surface node then it is not centered at 0,0,0. Of course that would be true. Or maybe you mean that BabylonJS is working fine but Blender is not. I have not looked into what Blender is doing (beyond seeing that its standard coordinate system supposedly does not match GLTF or ChimeraX). |
| 428 | | |
| 429 | | |
| 430 | | |
| 431 | | Maybe you can explain the exact steps you do in BabylonJS or Blender (open file, rotate using this exact method, rotation is not around expected |
| 432 | | |
| 433 | | center...) that is not behaving as you expect it to. |
| 434 | | |
| 435 | | |
| 436 | | |
| 437 | | Tom |
| 438 | | |
| 439 | | -- |
| 440 | | |
| 441 | | Ticket URL: <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.rbvi.ucsf.edu%2Ftrac%2FChimeraX%2Fticket%2F15899%23comment%3A16&data=05%7C02%7Ckristen.browne%40nih.gov%7Cdbb5cc2280014feb7a0a08dcd1e44476%7C14b77578977342d58507251ca2dc2b06%7C0%7C0%7C638616025531199452%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=MqMrtZk6hsWoe%2BEY18Zny8ppAg6a279t6uVjO6acn2A%3D&reserved=0<https://www.rbvi.ucsf.edu/trac/ChimeraX/ticket/15899#comment:16>> |
| 442 | | |
| 443 | | ChimeraX <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.rbvi.ucsf.edu%2Fchimerax%2F&data=05%7C02%7Ckristen.browne%40nih.gov%7Cdbb5cc2280014feb7a0a08dcd1e44476%7C14b77578977342d58507251ca2dc2b06%7C0%7C0%7C638616025531205367%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=QIP5YI0izNS7Rie23fzsqp5clw2T2Wvvw0pCkMq8rno%3D&reserved=0<https://www.rbvi.ucsf.edu/chimerax/>> |
| 444 | | |
| 445 | | ChimeraX Issue Tracker |
| 446 | | |
| 447 | | 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. |
| 448 | | }}} |
| 449 | | |