import { NextPage } from "next"; import Head from "next/head"; import Link from "next/link"; import * as THREE from "three"; import { PCDLoader } from "three/examples/jsm/loaders/PCDLoader"; import React, { use, useEffect, useRef, useState } from 'react'; const Home: NextPage = () => { const canvasRef = useRef(null); const [pointCloud, setPointCloud] = useState | null>(null); const [fov, setFov] = useState(1); useEffect(() => { // don't do this if we are on a phone if (canvasRef.current && canvasRef.current.children.length === 0) { const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera(fov, window.innerWidth / window.innerHeight, 0.1, 2000); const renderer = new THREE.WebGLRenderer(); renderer.setSize(window.innerWidth, window.innerHeight); renderer.setClearColor(0x000000, 0); // set clear color to transparent canvasRef.current.appendChild(renderer.domElement); const loader = new PCDLoader(); loader.load('/cloud1.pcd', (pointCloud) => { const geometry = pointCloud.geometry; const color = new THREE.Color(0x4f2342); const material = new THREE.PointsMaterial({ size: 1, color: color }); material.blending = THREE.AdditiveBlending; // set blending mode for glow effect const points = new THREE.Points(geometry, material); scene.add(points); points.scale.x = -1; if (points) setPointCloud(points); }); camera.position.z = 250; const animate = function (newFov: number) { if (newFov >= 100) { return; // Stop animation when fov reaches 100 } camera.fov = newFov; camera.updateProjectionMatrix(); const points = scene.children[0]; if (points instanceof THREE.Points) { // Make a new color that is following a gradient towards using Hex values let pointsNew = new THREE.Object3D(); if (points.material instanceof THREE.PointsMaterial) { if (points.material.color instanceof THREE.Color) { const initColor = points.material.color; const endColor = new THREE.Color(0xffffff); const color = initColor.clone().lerp(endColor, newFov / 100); if (points.geometry instanceof THREE.BufferGeometry) { const geometry = points.geometry; const material = new THREE.PointsMaterial({ size: 1, color: color }); material.blending = THREE.NormalBlending; pointsNew = new THREE.Points(geometry, material); scene.remove(points); } } } // Add random points to the scene or remove them and add new ones that are more spread out if (points.children.length > 0) { const randomPoints = points.children[0]; if (randomPoints instanceof THREE.Points) { points.remove(randomPoints); } } const randomGeometry = new THREE.BufferGeometry(); const randomMaterial = new THREE.PointsMaterial({ size: 1, color: 0x4f2342, }); randomMaterial.blending = THREE.NormalBlending; // Get the previous random points and move them inwards const randomPoints = new THREE.Points(randomGeometry, randomMaterial); const randomPositions = new Float32Array(1000 * 3); // Three values (x, y, z) for each vertex for (let i = 0; i < 1000 * 3; i += 3) { randomPositions[i] = Math.random() * 1000 - 500; // x-coordinate randomPositions[i + 1] = Math.random() * 1000 - 500; // y-coordinate randomPositions[i + 2] = Math.random() * 1000 - 500; // z-coordinate } randomGeometry.setAttribute("position", new THREE.BufferAttribute(randomPositions, 3)); randomGeometry.setAttribute("position", new THREE.BufferAttribute(randomPositions, 3)); // scene.add(randomPoints); // we need to add these points to the pointsNew object so that they are all in the same object // but we need to only change the position of the random points pointsNew.add(randomPoints); scene.add(pointsNew) } renderer.render(scene, camera); }; animate(1); window.addEventListener("scroll", () => { const scrollPosition = window.pageYOffset; const maxFov = 100; const minFov = 1; const maxScroll = (document.body.scrollHeight - window.innerHeight) / 15; const minScroll = 0; const fovRange = maxFov - minFov; const scrollRange = maxScroll - minScroll; const newFov = ((scrollPosition - minScroll) * fovRange) / scrollRange + minFov * 2; animate(newFov); }); } }, []); return ( <> Sagar's Space
{/* NAVIGATION BAR*/}
{/* WELCOME SECTION */}

Welcome to Sagar's Space!

Scroll down to explore!

{/* THREE.JS POINTCLOUD */}

What was that??!

{/* Find out more refrence to varian*/}
{/* CONTACT SECTION */}
logo

Who am I?

I am a second year Computer Science student @ TU Delft! Welcome to my space - an overview of some of my accomplishments to date.
{/* EDUCATION SECTION */}

Education

logo

Franconian International School

International Baccalaureate Diploma

Graduated in May 2022 with a score of 43/45. I was also the recepient of the FIS Award in 2022.
logo {/* Div for text components */}

Delft University of Technology

BSc. Computer Science & Engineering

{/* Create a list of divs that are cleanly colorfully formatted descrbing accomplishments */} Honours Programme (research under Dr. Ujwal Gadiraju), Delft Aerospace Rocket Engineering (DARE), and MakerSpace Delft.
{/* SKILLS SECTION */}

Skills

How comfortable am I with them?

I can go ahead and build a rocket with them 🚀! (Not literally but you get the point)
  • Java 💖
  • Python 🤍
  • HTML/CSS/JS 💝
  • TypeScript 💛
  • I can craft a cool app with them 📱
  • Figma 💗
  • C++ 💖
  • C 💌
  • I want to get to know them better 🤔
  • React 💙
  • Rust 💚
  • Scala 💜
  • {/* EXPERIENCE SECTION */}

    Experience

    {/* DARE */}
    logo

    Simulations Engineer @DARE (Stratos V)

    As an avid puzzler, I love learning new ways to apply my skills in Computer Science, either through my existing expertise in algorithms or by branching out into new fields. DARE is precisely this to me - an opportunity to get hands-down experience with the intricacy of engineering. As a simulations engineer I enjoyed applying my software development skills to aiding the launch of the Stratos V rocket!
    {/* VARIAN */}

    Research & Software Dev Intern @Varian

    Entering the year 2022, I was granted the opportunity to embark on a new computer science endeavor - computer vision. Under the guidance of Stefan Wiesner, I conducted a literature review to understand the world of computer vision concerning point clouds and meshes capturing the human body. I developed an extrema estimation software using an adapted version of Dijkstras algorithm. This computed the global maxima of a given human point cloud, labeling this vertex path from the centroid. Thanks once again to Varian and Stefan for taking me on board!
    {/* Button to the report */}
    logo
    {/* ADIDAS */}
    logo

    {/* App Dev Intern @Adidas*/} App Dev Intern @Adidas

    I have loved the art of application development, and to this day, I continue to cherish my first formal opportunity of doing exactly this! During my HS freshman summer, I was grateful enough to receive the opportunity to join the Adidas team in building a shoe raffle application based on their CONFIRMED Android Adidas app. Alongside another intern, I developed the raffle ticket system allowing users to randomly be selected for new shoe drops and, by doing so, make their day with free shoes :)
    {/* SIEMENS */}

    Data Scientist Working Student @Siemens Healthineers

    Interested in expanding my knowledge of computer science with a focus on data, I joined Siemens Healthineers as a working student in the summer of 2023. Here I familiarized myself with NLP tasks concerning language classification and machine translation using transformers and commerical services. I enjoyed developing my knowledge of data science and look forward to applying it in the future!
    logo
    {/* DIGIONKO */}
    logo

    Research Intern @DigiOnko

    DigiOnko is a country-wide medical project to aid breast cancer treatment and monitoring through machine learning. As a research intern, I helped conduct a systematic review of breast cancer risk parameters and assessed their ability to be implemented in technological integrations and machine learning algorithms. Thanks to the FAU Machine Learning and Data Analytics (Mad) Lab for allowing me to join their team temporarily :)
    {/* MAKERSPACE */}

    {/* Software Dev @ Makerspace Delft */} Software Dev @Makerspace Delft

    Currently working part-time at the non-profit Makerspace Delft! Centered around community, building, and passion, Makerspace is the perfect place to be challenged with new things every day! I currently assume many responsibilities but mainly work on upkeeping existing infrastructures and developing a new website :)
    logo
    {/* DIGITAL TWIN */}
    logo

    App Dev & UI/UX Intern @DigitalTwin

    After my experience with DigiOnko, I was also tasked with helping Digital Twin, a collaborative project between FAU and Adidas. As an application development intern, I helped design and integrate the existing Digital Twin application into a more modern and Adidas-like user interface. Through integrating sensor data and developing interfaces for both IOS and Android, Digital Twin expanded my programming horizons! Looking forward to seeing what they can achieve in the coming years.
    {/* KKF */}

    Volunteer @KKF

    Kannada Koota Franconia (KKF) is a place to chat, dance, have fun, but above all, reconnect and relish your cultural heritage. As a youth coordinator, I helped incentivize local engagement with south Asian traditions while raising funds for the less fortunate in events earnings. With a group of 250+ members, KKF sets off to reconnect south Asians across the globe.
    logo
    {/* FOOTER SECTION */}
    ); }; export default Home;