Skip to content

Commit

Permalink
internationally renowned physics bro suggests hyperbolic trajectories
Browse files Browse the repository at this point in the history
  • Loading branch information
RidwanSharkar committed Nov 19, 2024
1 parent 94d7c4d commit 6acf08c
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 44 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Planetfolio v2.0
# Planetfolio v2.2

![Planetfolio v2 0](https://github.com/user-attachments/assets/67420c06-3db2-4496-9796-9b7cdd9e9ee7)
1 change: 1 addition & 0 deletions public/textures/BorrowedOrder_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
108 changes: 69 additions & 39 deletions warpgate/EnhancedPlanetGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,22 @@ const EnhancedPlanetGroup: React.FC<EnhancedPlanetGroupProps> = ({ onSelectPlane
],
logoTexturePath: '/textures/Fretboardx_logo.png',
},
// PLANET 1.5: Spotify
{
position: [0, 0, 0],
link: 'https://open.spotify.com/user/1268486981',
label: 'Spotify',
description: 'getPlaylists()',
orbitRadius: 2.33,
orbitSpeed: 0.775,
planetColor: '#F9B9F2',
rings: [
{ color: 'white', innerScale: 1.2, outerScale: 1.5, inclination: Math.PI / 2 },
],
size: 0.225,
rotationSpeed: 0.02,
logoTexturePath: '/textures/Spotify_logo.svg',
},
// PLANET 2: LINKEDIN
{
position: [0, 0, 0],
Expand All @@ -99,6 +115,40 @@ const EnhancedPlanetGroup: React.FC<EnhancedPlanetGroupProps> = ({ onSelectPlane
],
logoTexturePath: '/textures/LinkedIn_logo.svg',
},
// PLANET 3,25: BORROWED ORDER
{
position: [0, 0, 0],
link: 'https://ridwansharkar.github.io/Borrowed-Order/',
label: 'Borrowed Order',
description: 'visualize()',
orbitRadius: 6.3,
orbitSpeed: 0.125,
startAngle: (2 * Math.PI) / 3,
planetColor: '#c7434d',
size: 0.24,
rotationSpeed: 0.03,
rings: [
{ color: '#00FFFF', innerScale: 1.3, outerScale: 1.45, inclination: -Math.PI / 3 }
],
logoTexturePath: '/textures/BorrowedOrder_logo.svg',
},
// PLANET 3.5: Nutrimancer
{
position: [0, 0, 0], // Starting on the opposite side of the orbit
link: 'https://github.com/RidwanSharkar/The-Nutrimancers-Codex',
label: "The Nutrimancer's Codex - Vol. II",
description: 'unknown()',
orbitRadius: 6.3,
orbitSpeed: 0.125,
startAngle: (4 * Math.PI) / 3,
planetColor: '#84DCC6', //85FFC7
rings: [
{ color: '#7EE081', innerScale: 1.25, outerScale: 1.6, inclination: Math.PI / 4.5 },
],
size: 0.325,
rotationSpeed: 0.01,
logoTexturePath: '/textures/Nutrimancer_logo.svg',
},
// PLANET 3: GITHUB
{
position: [0, 0, 0],
Expand Down Expand Up @@ -143,23 +193,7 @@ const EnhancedPlanetGroup: React.FC<EnhancedPlanetGroupProps> = ({ onSelectPlane
],
logoTexturePath: '/textures/Github_logo.svg',
},
// PLANET 3.5: Nutrimancer
{
position: [0, 0, 0], // Starting on the opposite side of the orbit
link: 'https://github.com/RidwanSharkar/The-Nutrimancers-Codex',
label: "The Nutrimancer's Codex - Vol. II",
description: 'unknown()',
orbitRadius: 6.3,
orbitSpeed: 0.125,
startAngle: Math.PI,
planetColor: '#84DCC6', //85FFC7
rings: [
{ color: '#7EE081', innerScale: 1.25, outerScale: 1.6, inclination: Math.PI / 4.5 },
],
size: 0.325,
rotationSpeed: 0.01,
logoTexturePath: '/textures/Nutrimancer_logo.svg',
},

// PLANET 4: IG ART STATION
{
position: [0, 0, 0],
Expand Down Expand Up @@ -212,22 +246,7 @@ const EnhancedPlanetGroup: React.FC<EnhancedPlanetGroupProps> = ({ onSelectPlane
],
logoTexturePath: '/textures/Mythos_logo.png',
},
// PLANET 6: Spotify
{
position: [0, 0, 0],
link: 'https://open.spotify.com/user/1268486981',
label: 'Spotify',
description: 'getPlaylists()',
orbitRadius: 4.7,
orbitSpeed: 0.47,
planetColor: '#F9B9F2',
rings: [
{ color: 'white', innerScale: 1.2, outerScale: 1.5, inclination: Math.PI / 2 },
],
size: 0.225,
rotationSpeed: 0.02,
logoTexturePath: '/textures/Spotify_logo.svg',
},

], []);

// Initialize refs for each planet
Expand Down Expand Up @@ -286,7 +305,7 @@ const EnhancedPlanetGroup: React.FC<EnhancedPlanetGroupProps> = ({ onSelectPlane
useEffect(() => {
const interval = setInterval(() => {
setExoplanets(prev => [...prev, Date.now()]); // timestamp as unique ID
}, 15000); // 30000 ms = 30 seconds
}, 15000);

return () => clearInterval(interval);
}, []);
Expand All @@ -296,6 +315,11 @@ const EnhancedPlanetGroup: React.FC<EnhancedPlanetGroupProps> = ({ onSelectPlane
setExoplanets(prev => prev.filter(exoId => exoId !== id));
};

const uniqueOrbitRadii = useMemo(() => {
const radii = planets.map(planet => planet.orbitRadius);
return Array.from(new Set(radii));
}, [planets]);

return (
<Suspense fallback={null}>
<Sun />
Expand All @@ -305,17 +329,23 @@ const EnhancedPlanetGroup: React.FC<EnhancedPlanetGroupProps> = ({ onSelectPlane
planetSizes={getPlanetSizes()}
onCollision={handleCollision}
/>
{/* Render orbit paths */}
{planets.map((planet, index) => (

{/* Render unique orbit paths */}
{uniqueOrbitRadii.map((orbitRadius, index) => (
<mesh key={`orbit-${index}`} rotation-x={Math.PI / 2}>
<ringGeometry
args={[
planet.orbitRadius,
planet.orbitRadius + 0.05,
orbitRadius,
orbitRadius + 0.05,
64,
]}
/>
<meshBasicMaterial color="#ffffff" opacity={0.08} transparent side={THREE.DoubleSide}/>
<meshBasicMaterial
color="#ffffff"
opacity={0.08}
transparent
side={THREE.DoubleSide}
/>
</mesh>
))}

Expand Down
8 changes: 4 additions & 4 deletions warpgate/Exoplanet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const Exoplanet: React.FC<ExoplanetProps> = ({ onRemove }) => {
// Constants for simulation
const SPAWN_RADIUS = 50;
const HYPERBOLIC_THRESHOLD = 40; // GRAVITY INFLUENCE
const MIN_DISTANCE = 2;
const BASE_GRAVITY_STRENGTH = 0.10; // GRAVITY STRENGTH
const CLOSE_APPROACH_THRESHOLD = 8; // APPROACH THRESHOLD
const MIN_DISTANCE = 1.8; // ACTUAL COLLSION SIZE
const BASE_GRAVITY_STRENGTH = 0.15; // GRAVITY STRENGTH
const CLOSE_APPROACH_THRESHOLD = 2.3; // APPROACH THRESHOLD

const targetPoint = useMemo(() => {
const radius = Math.random() * 7; // COLLISION ZONE
const radius = Math.random() * 10; // COLLISION PLANE
const theta = Math.random() * 2 * Math.PI;
const phi = Math.acos(2 * Math.random() - 1);
return new Vector3(
Expand Down

0 comments on commit 6acf08c

Please sign in to comment.