Moving texture with mouse (drag'n'drop)

24 October 2017 12:33
Hi Community,

We're developing a product configurator, and one of the challenges is the possibility to upload a logo in a configurator and use it on defined print areas of a product.

Print areas are created as separate objects in Blender and placed to specified positions. The texture type of print areas is set to "None" and "Export Options" -> "Source Type" is set to "Canvas". I can get a CanvasRenderingContext2D object in API and then manipulate it: put the uploaded logo to UV-mapped rectangle, move the logo within a mapped area (which also moves the logo on a product) and so on.

So far so good, but all the controls for logo manipulation are out of 3D scene. Basically it is a div box with buttons "left", "right", "top", "bottom", "rotate" etc. The customer wants to get rid of these buttons and the div box. The idea is to make it possible to drag the logo directly at 3D Object, but I‘m not sure if this is possible, and if possible how complicated is the solution?

I can imagine, that I need to lock the camera controls in case of print areas configuration, and then somehow understand how far and in which direction the move was made. Probably it should nothing to do with a 3D Scene, just put some overlay on a canvas with "mouseup" and "mousedown" event handlers.

Did someone do something similar? Is it possible at all?
Please register or log in to leave a reply.