-
Notifications
You must be signed in to change notification settings - Fork 151
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
i want to be able to add a different color for a specific satellite. #66
Comments
@zen85 using the accessor method three-globe/example/satellites/index.html Lines 46 to 48 in 7852f41
In the supplied example all of them are equal, but you can differentiate them if you like, using the input parameter of that method: myGlobe.objectThreeObject(sat => /* your code */) |
i dont really get it completly... i tried to add the following lines to the example but apparently it still turns all the satellites from yellow to green:
here you can see where the lines are located exactly:
|
I think there's some confusion on how the So you can use it to conditionally use different Three objects depending on what the data item is. For example, if you want to have one geometry/material for the ISS, and a different one for all others you could do: // define the various geometries / materials needed
const generalGeometry = new THREE.OctahedronGeometry(GENERAL_SIZE * Globe.getGlobeRadius() / EARTH_RADIUS_KM / 2, 0);
const generalMaterial = new THREE.MeshLambertMaterial({ color: 'blue', transparent: true, opacity: 0.4 });
const issGeometry = new THREE.OctahedronGeometry(ISS_SIZE * Globe.getGlobeRadius() / EARTH_RADIUS_KM / 2, 0);
const issMaterial = new THREE.MeshLambertMaterial({ color: 'green', transparent: true, opacity: 1 });
Globe.objectThreeObject(d =>
d.name === 'VANGUARD 2'
? new THREE.Mesh(issGeometry, issMaterial)
: new THREE.Mesh(generalGeometry, generalMaterial)
); |
oh yes. you were right - i didn't understand the concept before. Now it works amazingly! |
In my application it would be great if i can track specific satellites visually. right now all of them have the same geometry and color.
If possible i would like to be able to store satellite names in an array and whenever i put a name or even part of a name in it i can define a different color for the matching satellites (iE turn all satellites with "starlink" in the name pink)
I tried to do a second fetch and add just the tle data of the ones that are interessting for me in it while still showing the others but i cannot get it to work.
The application i am doing should be able to show generall traffic of all satellites but sometimes i want to see specific satellites within the swarm of satellites.
The text was updated successfully, but these errors were encountered: