yomotsu / camera-controls

A camera control for three.js, similar to THREE.OrbitControls yet supports smooth transitions and more features.

Home Page:https://yomotsu.github.io/camera-controls/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do I run examples that view the repository itself?

WaterSeeding opened this issue · comments

commented

Hello, could you please tell me how I can run and view the examples of the warehouse in my browser

image
image

As shown in the figure, although I run npm run dev, the path to view examples is not displayed. I am not very familiar with these configurations, could you please tell me how to run the command to view examples,thank you

I think you can simply open http://localhost:3000/ in your browser.
note: examples is the root dir.

commented

I think you can simply open http://localhost:3000/ in your browser. note: examples is the root dir.

Hello, now I drop down and run the warehouse code again. http://localhost:3000/ on my computer can run successfully, as shown in the picture:
image

But there was another problem. I could see the contents of the jpg and svg images,
image

But when I open the basic HTML (or other HTML page), can't see the full content, network failed to get http://localhost:3000/dist/camera-controls.module.js tip
image
image

There are dist folder and camera-controls.module.js file in my local running warehouse. May I ask what caused this problem,Thank you

Actually you need run ‘npm run build’ for the dist if you trying with an old version.
Can you try with the latest version?
For more details, please refer the package.json

commented

Actually you need run ‘npm run build’ for the dist if you trying with an old version. Can you try with the latest version? For more details, please refer the package.json

I re-deleted the contents of dist and node_modules folder, and re-git pull the latest code, but I ran the project npm run build and npm run dev, and the content I found still failed to get camera-controls.module.js

image

image

image

I guess I'm the only one with this problem? (laughing and crying)

Thanks for the captures.
According to the captures you provided,
the file is generated into the dist folder and launches a local server with port:3000, which is expected.

maybe the alias:
https://github.com/yomotsu/camera-controls/blob/dev/examples/dist
may not work in Windows...?

I will test it in Windows this weekend just in case.

commented

Thanks for the captures. 感谢您的捕获。 According to the captures you provided,根据您提供的捕获, the file is generated into the dist folder and launches a local server with port:3000, which is expected.该文件将生成到 dist 文件夹中,并启动端口为 3000 的本地服务器,这是预期的。

maybe the alias: 也许别名: https://github.com/yomotsu/camera-controls/blob/dev/examples/dist may not work in Windows...? 可能无法在Windows中工作...?

I will test it in Windows this weekend just in case.我将在本周末在 Windows 中对其进行测试,以防万一。

Thank you very much for your patient explanation and answering questions! I really want to learn your repository code, it's really good, so I want to run the instructions on package.json successfully to see the full example! Sorry, I forgot to note that the computer system is win10.

@WaterSeeding
By the way, in the meantime, you can do:

  1. $ npm run dev:rollup for watch
  2. then, launch a local server at the project's root

then open localhost:XXXX/examples/ in your browser