-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Satellites should have a rotational motion in addition to its translational motion #71
Comments
i just created the the shortest code possible to show my problem and to do tryouts:
|
@zen85 just a heads up that there's two new props on the objects layer that might help with your use case. They are:
The first one, if enabled changes the object orientation to always follow the curve of the globe. While the second allows you to apply any additional custom rotation to the object. So for your case, I believe one way to achieve it would be to enable Let me know if this works out for you. And an example on https://codepen.io/ would be great. 👍 |
oh that sound amazing! i am addicted to this... I already built a monster of a solution which worked though already. funny enough it stopped working 2 days ago with 2.26.0 so i took a bit of a dive now and i found out while doing: (please mind that i added the property "noradID" to the satellitemeshes for easy identification :) ); var objekt_zum_ausrichten = Globe.getObjectByProperty('noradID', params.cam_to_norad); gave me proper value just gives me 0,0,0 now. if i switch back to 2.25.7 i get proper values so something must have happened :) I dont know yet what changed since i cant see your changes to the new version apparently? why does the .position value not have proper values anymore for meshes in this layer? |
Ah, I see. Because of the rotation functionality the structure of the ThreeJS object being added to the globe has changed. From v2.26 on we wrap your user object in a group, to which we apply the necessary rotation (to face the surface) and position. And the specific local rotation gets applied to the object directly. Previously rotation didn't exist and positioning was applied directly to the object. That's why you see that change. So, you could theoretically now extract the position from the parent, but taking a step back, it's better if you don't rely on the inner works and structure of an globe object directly in your app as these are bound to change from time to time and without notice, due to refactors and new functionality, etc. They're internal implementation details, if you will. And btw, here's the commit with the relevant changes, you should be able to see that: |
i love way to much playing around with this but now i ran into a problem i can not solve...
I want to change the satellites example so that i can change the satGeometry to
const satGeometry = new THREE.BoxGeometry(10, 5,2);
it becomes very apparent that the meshes of the satellites do not have rotational motion corresponding to the direction they are heading to.
It would be ideal if the meshes of the satellites would behave like animated planes would.
I tried something like this in my frameTicker
which works kind of but still rotates around one axis.
so i tried to put a carot in front of the satellite but with the same outcome on a different axis... :(
Any Ideas?
The text was updated successfully, but these errors were encountered: