Closed KatieWoe closed 4 years ago
Regarding the location of the dialog box: Centering only occurs correctly after adjusting the screen bounds. If the molecule Three.3DObject
is removed from the dialog, this isn't a problem, so I think this has to do with an internal layout problem with the object itself, not dialog.
I'm not sure whether this is due to an implementation detail in BAM or Mobius, but I will pair with @jonathanolson to figure out.
Also, a molecule can be off-center:
In regards to the dialog box being centered: The issue is that the content was being added after the dialog was being initialized. Dialog handles this by resizing the dialog box to the newly added content (see resize
in Dialog.options). However, the now resized dialog doesn't re-center itself (see layoutStrategy
in Dialog.options). @jonathanolson thought we should log an issue about the Dialog behavior.
Solution: Create the content for the Dialog and then initialize the dialog with the content. Don't add it after initialization. This centered the Dialog box on the screen.
The molecules themselves still need a fix (https://github.com/phetsims/build-a-molecule/issues/111#issuecomment-557711710).
The rendering of the molecules in the dialog are now supported via ThreeJS. There is still an issue of positioning as described in https://github.com/phetsims/build-a-molecule/issues/111#issuecomment-557711710. The molecules that are required for the collection boxes have been fixed but a more general solution should be applied here.
Looking at CompleteMolecule.PubChemAtom2
it is constructed with molecule data that supports 2d modeling but not 3d modeling. For molecules like this (borane, thioxoboron, trifluoromethane, etc), we don't currently have a good means of converting that data that syncs well with ThreeJS. We should either look to using different modeling data for the molecules without 3d data or find a better conversion.
Model molecule data has been adjusted in the above commits. This should affect the specified molecules in the collection boxes and all molecules that can be modeled with the 3d dialog but don't have 3d data (of type PubChemAtom2
)
@KatieWoe or @arouinfar Can you see if this is still an issue in this dev version? That also means the centering of molecules here https://github.com/phetsims/build-a-molecule/issues/111#issuecomment-557711710.
I am unable to reproduce in dev.43, but I'll leave it to @KatieWoe to verify.
Checked several molecules and it is looking pretty good in that dev test
Thanks a lot for the verification. Closing this one.
Test device Dell Operating System Win 10 Browser Chrome Problem description For https://github.com/phetsims/QA/issues/459 The 3D view of the model is partially off the screen when it comes up. Changing the window size seems to fix this. Some of the molecules, such as the ball and stick view, look wrong as well.
Visuals
Troubleshooting information: