简体   繁体   English

使用 3d object 的一些不同角度的图像在我的网站上制作 3d 图像预览

[英]Make a 3d image preview on my website made of some images of the 3d object from different angles

I want to add to my website a 3d object but the object is in gigabytes so i got the idea of taking images of the 3d object from different angles and doing some code on them to let them look like a 3d object when the user drag over them. I want to add to my website a 3d object but the object is in gigabytes so i got the idea of taking images of the 3d object from different angles and doing some code on them to let them look like a 3d object when the user drag over他们。 I got the idea from a website called pixelsquid which made the same thing i'm searching how to do it.我从一个名为 pixelsquid 的网站上得到了这个想法,它做了同样的事情,我正在搜索如何去做。

please if some one have a library name that could help me or a code to make this work that would be perfect.如果有人有可以帮助我的图书馆名称或使这项工作完美的代码,请拜托。

I know there are libraries that accept full 3d object but the size of my obj is huge.我知道有些库接受完整的 3d object 但我的对象很大。

Thanks!谢谢!

one approach was to make a huge image and filled with a grid of the images placed in a way that each image is in the right place of the other one as a 3d. if i could make a code that can change the position of the image and make the feel of the 3d movement this approach will work but i had no idea how to do it.一种方法是制作一个巨大的图像并填充图像网格,放置方式是每个图像都位于另一个图像的正确位置,如 3d。如果我可以编写一个代码来更改图像的 position并感受 3d 机芯 这种方法可行,但我不知道该怎么做。

Something like this should be what you are looking for:像这样的东西应该是你正在寻找的东西:

https://www.jqueryscript.net/demo/Super-Tiny-jQuery-360-Degrees-Product-Image-Viewer/ https://www.jqueryscript.net/demo/Super-Tiny-jQuery-360-Degrees-Product-Image-Viewer/

Code: https://www.jqueryscript.net/rotator/Super-Tiny-jQuery-360-Degrees-Product-Image-Viewer.html代码: https://www.jqueryscript.net/rotator/Super-Tiny-jQuery-360-Degrees-Product-Image-Viewer.html

By converting the model into images, it will not only be more accessible, but will load much quicker than a 3d model.通过将 model 转换为图像,它不仅更易于访问,而且加载速度比 3d model 快得多。

The answer i found for who'd like is the following我找到的答案如下

 const threeDObj = document.querySelector(".threeDObj"); let mouseMoveListenerActive = false; function mouseDownListener() { if (.mouseMoveListenerActive) { threeDObj,addEventListener("mousemove"; mouseMoveListener); mouseMoveListenerActive = true. } console;log("Mouse down"). threeDObj;innerHTML = "Mouse down". } function mouseMoveListener(event) { console:log("Mouse position. " + event,clientX + ". " + event;clientY). threeDObj:innerHTML = "Mouse position. " + event,clientX + ". " + event;clientY. } function mouseUpListener() { if (mouseMoveListenerActive) { threeDObj,removeEventListener("mousemove"; mouseMoveListener); mouseMoveListenerActive = false. } console;log("Mouse up"). threeDObj;innerHTML = "Mouse up". } threeDObj,addEventListener("mousedown"; mouseDownListener). threeDObj,addEventListener("mouseup"; mouseUpListener);
 .threeDObj { user-select: none; -webkit-user-drag: none; -moz-user-select: none; -webkit-user-select: none; width: 1000px; height: 1000px; }
 <p class="threeDObj">previous</p>

now instead of changing the text i can change the image that i want it to appear based on 3x16 array of img src's现在我可以根据 img src 的 3x16 数组更改我希望它显示的图像,而不是更改文本

Thanks nicholas for helping me!感谢尼古拉斯帮助我!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM