Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
Add dynamic texture to model using three js and React Three Fiber and gltfjsx

I wanted to try three js and following this tutorial https://www.youtube.com/watch?v=xy_tbV4pC54, i was able to run it

enter image description here

What i wanted to do now is adding image texture on top of the model something like this

https://osorina.github.io/cup-demo/image/

enter image description here

i haven't tried any code because im still looking for a way to do it, some say that i need to use fabricjs but i cant find any helpful resource that suits my needs, hope someone here know how to do something like cup demo above.

Here's the sandbox https://codesandbox.io/s/floating-shoe-forked-qxjoj, thanks in advance

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

you can overwrite pre-defined props

import { useGLTF, useTexture } from '@react-three/drei'

function Model() {
  const { nodes, material } = useGLTF(...)
  const texture = useTexture("/texture.jpg")
  ...
  return (
    <group>
      <mesh geometry={...} material={...} material-map={texture} />

you can also flat out replace an existing material:

<mesh geometry={...}>
  <meshStandardMaterial map={texture} />
</mesh>

just be aware that textures need proper UV coordinates which are usually set in blender or the modelling software. you can't just put an imagine on something and expect it to just align.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!