adding some sample models
This commit is contained in:
parent
9bf77bd637
commit
f4945bc19d
|
@ -12,6 +12,7 @@ export function CanvasComponent({setCanvasRef, gltfModel}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Canvas
|
<Canvas
|
||||||
|
camera={{ fov: 40, position: [0, 0, 5]}}
|
||||||
gl={{ alpha:true, preserveDrawingBuffer: true }}
|
gl={{ alpha:true, preserveDrawingBuffer: true }}
|
||||||
>
|
>
|
||||||
<Scene gltfModel={gltfModel} setCanvasRef={setCanvasRef}/>
|
<Scene gltfModel={gltfModel} setCanvasRef={setCanvasRef}/>
|
||||||
|
@ -28,14 +29,14 @@ function Scene({ setCanvasRef, gltfModel }) {
|
||||||
|
|
||||||
// Set camera position closer to the object
|
// Set camera position closer to the object
|
||||||
// camera.position.set(0, 0, 5); // x, y, z
|
// camera.position.set(0, 0, 5); // x, y, z
|
||||||
|
|
||||||
setCanvasRef(gl.domElement);
|
setCanvasRef(gl.domElement);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ambientLight />
|
<ambientLight />
|
||||||
<pointLight position={[1, 1, 1]} />
|
<pointLight position={[1, 1, 1]} />
|
||||||
<Light brightness={100} color={"white"} /> // highlight-line
|
<Light brightness={100} color={"white"}/> // highlight-line
|
||||||
<Model gltfModel={gltfModel} position={[0, 0, 0]} />
|
<Model gltfModel={gltfModel} position={[0, 0, 0]} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -50,7 +51,7 @@ function Model({ gltfModel, ...props }) {
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<group
|
<group
|
||||||
scale={10}
|
scale={1}
|
||||||
>
|
>
|
||||||
<primitive object={gltfModel.scene} />
|
<primitive object={gltfModel.scene} />
|
||||||
</group>
|
</group>
|
||||||
|
@ -64,7 +65,7 @@ function Light({ brightness, color }) {
|
||||||
height={3}
|
height={3}
|
||||||
color={color}
|
color={color}
|
||||||
intensity={brightness}
|
intensity={brightness}
|
||||||
position={[-2, 0, 5]}
|
position={[7, 0, 3]}
|
||||||
lookAt={[0, 0, 0]}
|
lookAt={[0, 0, 0]}
|
||||||
penumbra={1}
|
penumbra={1}
|
||||||
castShadow
|
castShadow
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -78,7 +78,7 @@ export default function Studio(){
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
prompt: promptText + ", photorealistic, high resolution product photography",
|
prompt: promptText + ", photorealistic, high resolution product photography, don't modify product",
|
||||||
negative_prompt: "blurry, painting, cartoon, abstract, ugly, deformed",
|
negative_prompt: "blurry, painting, cartoon, abstract, ugly, deformed",
|
||||||
image: image,
|
image: image,
|
||||||
mask: mask,
|
mask: mask,
|
||||||
|
|
Loading…
Reference in New Issue