google / model-viewer

Easily display interactive 3D models on the web and in AR!
https://modelviewer.dev
Apache License 2.0
6.84k stars 807 forks source link

sampler.setOffset doesn't move my texture #4428

Closed xeiaaa closed 11 months ago

xeiaaa commented 1 year ago

Description

When i try to run sampler.setOffset, the texture doesn't move. setRotation and setScale does work correctly though. is there anything i missed? image

Here's my code for the slider

<Slider
          aria-label="slider-ex-1"
          defaultValue={0}
          mt={4}
          onChange={(e) => {
            const offset = {
              x: -e * 20,
              y: -e * 20,
            };
            console.log(sampler.offset);
            sampler.setOffset(offset);
          }}
        >
          <SliderTrack>
            <SliderFilledTrack />
          </SliderTrack>
          <SliderThumb />
        </Slider>
elalish commented 1 year ago

Hmm, it seems to be working in our example. Can you find the difference between that and your site, or perhaps show us a minimal repro? Also, what MV version are you using?

diegoteran commented 11 months ago

Hi @xeiaaa, is this still an issue for you? Can you share how to repro or any console logs that the behavior outputted?

diegoteran commented 11 months ago

There were some recent changes in #4473 , I'll assume this fixes it since can't repro the error. Feel free to open an issue if it still doesn't work for you.