How to run my Three.js application under Visual Studio?

This is the Three.js application that a capable programmer is developing for me:

http://www.dealey-plaza.org/this-government-as-promised/SBT-MBT-Tools/Haags-Measurement-Tool/Pinocchio-Nose/

Using the mouse, you can control the angle of oscillation by the robot’s leg. The distance between the click point and the release point determines the angle.

As you can see above, the application runs fine in my Linux server. However, I would like to run it, and learn using Visual Studio (2017). I have found some instructions on YouTube, but they are old.

Apparently I need to attach the running code to a process?

See enclosed images.

TIA,

-Ramon F. Herrera
JFK Numbers



  1. So what you want to do is create a web server in VS? Or connect VS to an existing web server for live reload? Or debug server code with VS?
  2. Wouldn’t it be easier to use Visual Studio Code ? Original Visual Studio wasn’t very useful for web development pretty much at all - besides just being a text editor.
    VSCode is created with web in mind, plus it has a lot of plugins that will do what you are attempting to do automatically.
1 Like

Affirmative. I would like to do some development. Initially it would be minimum involvement, just timid steps toward learning: inserting break points, that sort of programming lite.

I figured that since Visual Studio is expensive while Visual Studio Code is free, the former would be better.

VS Code was recently installed in my PC, but I had the exact same problem: “Where do I click on ‘Run’?”

Thanks!

-Ramon F. Herrera
JFK Numbers

ps: What do you mean by “server code”. I am told the Three.js runs entirely on the client (aka browser).

pps: All my production is immediately placed in the public domain. One of the web apps that I would like to run under Visual Studio [Regular and/or Code] is here:

[Web site will not allow me to donate my code to the community]

The source code in question, plus the controlled robot model are here:

http://www.dealey-plaza.org/this-government-as-promised/humor-and-animations/FBX-Rigged-Robot/

I need all the help I can get in this project.

TIA,

-Ramon
JFK Numbers

If am trying to use Visual Studio Code and the problem is identical. Chrome (the only browser that seems to be up to the task) does not like being approached in such manner.

I will try a “Hello, world!” page, to see whether I can persuade Chrome to cooperate.

Thanks!

-Ramon
JFK Numbers

Sorry, I’m very slow.

Not for web development, definitely VSCode. Visual Studio is good for C++/C#, just native programming.

Yes, three.js is client. But to have anything run in the browser it has to be server by a server / hosting.

You don’t share much information about how the project is constructed so it’s not easy to help. Web project needs some kind of local server to let you launch and debug it in the browser. VS Code has a debugging server that you can find under the small bug icon on the left. It allows you to create a launch configuration, opens Chrome for you, and automatically reload the app when something changes.

Even simpler is the VSCode liveserver plugin.

Also check out How to run things locally in the three.js docs.

2 Likes