diff --git a/apps/www/components/LaunchWeek/14/canvas.tsx b/apps/www/components/LaunchWeek/14/canvas.tsx index 9d59d9c3458..428c88f0840 100644 --- a/apps/www/components/LaunchWeek/14/canvas.tsx +++ b/apps/www/components/LaunchWeek/14/canvas.tsx @@ -79,10 +79,12 @@ const LwCanvas = ({ className }: { className?: string }) => { // Load the ticket texture and create the actual ticket mesh // Replace this URL with your actual ticket texture const ticketScene = '/images/launchweek/14/supabase-ticket.glb' + const ticketStaticTexture = '/images/launchweek/14/supabase-static-ticket.png' createTicketMesh(ticketScene, { width: planeGeometrySize[0], height: planeGeometrySize[1], + ticketTextureSource: ticketStaticTexture, debug }) .then((ticketModel) => { @@ -160,15 +162,6 @@ const LwCanvas = ({ className }: { className?: string }) => { const animate = (time?: number) => { const currentTime = time || 0 - // if (ticket) { - // // Add very subtle floating animation with reduced amplitude - // // Smoothly interpolate current position toward target (mouse) position - // const lerpFactor = 0.05 // Lower value = smoother/slower follow - // - // ticket.position.y += - // (targetY - ticket.position.y) * lerpFactor + Math.sin(currentTime * 0.0007) * 0.02 - // } - // // Update CRT shader time uniform for animation effects if (crtPass) { crtPass.uniforms.time.value = currentTime diff --git a/apps/www/components/LaunchWeek/14/helpers.ts b/apps/www/components/LaunchWeek/14/helpers.ts index 0e0db6f8bca..7d17b92e099 100644 --- a/apps/www/components/LaunchWeek/14/helpers.ts +++ b/apps/www/components/LaunchWeek/14/helpers.ts @@ -232,9 +232,9 @@ export const loadGLTFModel = (url: string): Promise => { export const createTicketMesh = async ( source: string, options: { + ticketTextureSource?: string width?: number height?: number - forceTextureMode?: boolean enhanceEmissive?: boolean debug?: boolean materialOptions?: { @@ -246,18 +246,26 @@ export const createTicketMesh = async ( } = {} ): Promise => { try { - // const width = options.width || 4 - // const height = options.height || 2 - // - // Determine if we should use texture mode - const useTextureMode = - options.forceTextureMode || !(source.endsWith('.glb') || source.endsWith('.gltf')) + const useTextureMode = !(source.endsWith('.glb') || source.endsWith('.gltf')) if (!useTextureMode) { // Load the GLTF model const model = await loadGLTFModel(source) + const ticketTexture = options.ticketTextureSource ? await loadTexture(options.ticketTextureSource) : null - const objectsNames = ['planet', 'name', 'time', 'date'] as const + if(ticketTexture) { + const ticket = model.getObjectByName('ticket') + if (ticket instanceof THREE.Mesh) { + ticket.material = new THREE.MeshBasicMaterial({ + map: ticketTexture, + side: THREE.DoubleSide, + transparent: true, + depthWrite: false, + }) + } + } + + const objectsNames = ['planet', 'name', 'time', 'date', 'spicies', 'number'] as const const namedObjects = getNamedTextObjects(objectsNames, model) const textures = {} as { [key in (typeof objectsNames)[number]]?: ReturnType @@ -289,6 +297,14 @@ export const createTicketMesh = async ( text = '03/24/2025' break + case 'spicies': + text = 'Modern human' + break + + case 'number': + text = 'A001' + break + default: objectName satisfies never } @@ -384,31 +400,6 @@ export const createTicketMesh = async ( } } -/** - * Helper function to create a ticket mesh specifically from a texture - * @param textureUrl URL of the texture to use for the ticket - * @param options Configuration options for the ticket - * @returns Promise that resolves with the created mesh - */ -export const createTextureTicketMesh = async ( - textureUrl: string, - options: { - width?: number - height?: number - materialOptions?: { - transparent?: boolean - emissiveColor?: THREE.Color | number - emissiveIntensity?: number - color?: THREE.Color | number - } - } = {} -): Promise => { - return createTicketMesh(textureUrl, { - ...options, - forceTextureMode: true, - }) as Promise -} - /** * Custom hook for Three.js setup and animation * @param setupCallback Callback function for setting up the scene diff --git a/apps/www/public/images/launchweek/14/supabase-static-ticket.png b/apps/www/public/images/launchweek/14/supabase-static-ticket.png new file mode 100644 index 00000000000..d6e4d222325 Binary files /dev/null and b/apps/www/public/images/launchweek/14/supabase-static-ticket.png differ diff --git a/apps/www/public/images/launchweek/14/supabase-ticket.glb b/apps/www/public/images/launchweek/14/supabase-ticket.glb index 93b74b47bda..dd06a890f3b 100644 Binary files a/apps/www/public/images/launchweek/14/supabase-ticket.glb and b/apps/www/public/images/launchweek/14/supabase-ticket.glb differ