-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a310fbc
commit 5ca32e3
Showing
9 changed files
with
727 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
declare module '*.glb' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
|
||
|
||
/** @type {import('next').NextConfig} */ | ||
const nextConfig = { | ||
// basePath: "/facial-access-control", <==== required for github pages only. | ||
output: "standalone", | ||
output: "standalone", | ||
webpack(config) { | ||
config.module.rules.push({ | ||
test: /\.(glb|gltf)$/, | ||
use: [ | ||
{ | ||
loader: 'file-loader', | ||
options: { | ||
publicPath: '/_next/static/models/', | ||
outputPath: 'static/models/', | ||
name: '[name].[ext]', | ||
}, | ||
}, | ||
], | ||
}); | ||
return config; | ||
}, | ||
}; | ||
|
||
export default nextConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React, { Suspense } from 'react' | ||
import { Canvas } from '@react-three/fiber' | ||
import {Head} from '@/models/Head.jsx' | ||
import { Box, Button } from '@/components/ui' | ||
|
||
const FacescanCanvas = () => { | ||
return ( | ||
<Box className='grow flex p-8 flex-col justify-center align-center w-full' id="canvas-container"> | ||
<Canvas className='' camera={{ near: 0.1, far: 1000, position: [0, 0, 10] }}> | ||
<Suspense fallback={null}> | ||
<directionalLight position={[0, 0, 5]} color="white" /> | ||
<Head /> | ||
</Suspense> | ||
</Canvas> | ||
<Button variant='light' colorscheme='secondary' className='mx-8'>Start recording</Button> | ||
</Box> | ||
) | ||
} | ||
|
||
export default FacescanCanvas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { Button, Input, Password, Row, Stack, Text } from '@/components/ui' | ||
import { Box } from '@react-three/drei' | ||
import React from 'react' | ||
|
||
const OnboardingForm = () => { | ||
return ( | ||
<form className='w-full h-full'> | ||
<Stack className='gap-4 grow-0'> | ||
<Row className='gap-4'> | ||
<Stack> | ||
<Text as='label' htmlFor="firstname">First Name</Text> | ||
<Input type="text" id="firstname" name="firstname" placeholder='first name' required/> | ||
</Stack> | ||
<Stack> | ||
<Text as='label' htmlFor='lastname'>Last Name</Text> | ||
<Input type='text' id='lastname' name='lastname' placeholder='last name' required/> | ||
</Stack> | ||
</Row> | ||
<Row> | ||
<Stack className='w-full'> | ||
<Text as='label' htmlFor='email'>Email</Text> | ||
<Input | ||
type="text" | ||
name="email" | ||
id="email" | ||
placeholder="email" | ||
required | ||
/> | ||
</Stack> | ||
</Row> | ||
<Stack> | ||
<Text as='label' htmlFor='password'>Password</Text> | ||
<Password | ||
name="password" | ||
id="password" | ||
placeholder="password" | ||
required | ||
/> | ||
</Stack> | ||
<div className='border-2'><Text as='p'>No recording added yet</Text></div> | ||
<Button type="submit" name="Sign in" variant="solid" width='full' className='place-self-end'> | ||
Submit | ||
</Button> | ||
</Stack> | ||
|
||
</form> | ||
) | ||
} | ||
|
||
export default OnboardingForm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
Auto-generated by: https://github.com/pmndrs/gltfjsx | ||
Author: CHMIL Studio (https://sketchfab.com/chmilstudio) | ||
License: CC-BY-4.0 (http://creativecommons.org/licenses/by/4.0/) | ||
Source: https://sketchfab.com/3d-models/chmil-mannequin-bust-2024-d5606415cb9e44009b562942b23e943f | ||
Title: CHMIL Mannequin Bust 2024 | ||
*/ | ||
|
||
import React, { useRef } from 'react' | ||
import { useGLTF } from '@react-three/drei' | ||
import model from '../assets/3d/chmil_mannequin_bust_2024.glb' | ||
import { useFrame } from '@react-three/fiber'; | ||
|
||
export function Head(props) { | ||
const headRef = useRef(); | ||
const { nodes, materials } = useGLTF(model) | ||
|
||
useFrame(({ clock }) => { | ||
if (headRef.current) { | ||
// Calculate rotation angle using sine wave | ||
let angle = Math.sin(clock.getElapsedTime()) * Math.PI / 2; // Adjust the amplitude as needed | ||
|
||
// Clamp rotation angle to be within -90 degrees to 90 degrees | ||
headRef.current.rotation.y = Math.max(-Math.PI / 2.5, Math.min(angle, Math.PI / 2.5)); | ||
} | ||
}); | ||
|
||
return ( | ||
<group ref={headRef} {...props} dispose={null}> | ||
<group rotation={[-Math.PI / 2, 0, 0]}> | ||
<mesh | ||
castShadow | ||
receiveShadow | ||
geometry={nodes.final_for_upload_final_for_upload0_0.geometry} | ||
material={materials.final_for_upload0} | ||
rotation={[Math.PI / 2, 0, 0]} | ||
scale={0.1} | ||
/> | ||
</group> | ||
</group> | ||
) | ||
} | ||
|
||
useGLTF.preload(model) |
Oops, something went wrong.