简体   繁体   English

如何使 3D 对象跟随网页中的光标?

[英]How to make a 3D object follow cursor in a webpage?

I'm still new to web design and I am about to make my portfolio.我对网页设计还是个新手,我即将制作我的作品集。 I'm a designer who has worked in 2D and 3D art and would like my main page to show a 3D rendering of myself, that follows the mouse.我是一名从事 2D 和 3D 艺术工作的设计师,希望我的主页显示我自己的 3D 渲染,跟随鼠标。 Much in the style of the following website:与以下网站的风格非常相似:

https://wannabe-store.webflow.io/ https://wannabe-store.webflow.io/

Does anyone have any suggestion on where to begin with this?有没有人对从哪里开始有任何建议? What filetype do i render(i use blender), Can it be embedded in HTML?我渲染什么文件类型(我使用搅拌机),它可以嵌入在 HTML 中吗? can the movement be coded in javascript perhaps?运动可以用javascript编码吗?

Thank you for your patience, any help is welcome!感谢您的耐心等待,欢迎任何帮助!

The linked website used Canvas to show the 3D model following arrow cursor.链接的网站使用Canvas显示跟随箭头光标的 3D 模型。 The following links might help you to achieve some of your goals.以下链接可能会帮助您实现某些目标。

Javascript - Track mouse position Javascript - 跟踪鼠标位置

https://www.html5canvastutorials.com/advanced/html5-canvas-mouse-coordinates/ https://www.html5canvastutorials.com/advanced/html5-canvas-mouse-coordinates/

https://tympanus.net/codrops/2019/10/14/how-to-create-an-interactive-3d-character-with-three-js/ https://tympanus.net/codrops/2019/10/14/how-to-create-an-interactive-3d-character-with-three-js/

Thank you!谢谢!

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

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