当前位置:网站首页>Games202 operation 0 - environment building process & solving problems encountered
Games202 operation 0 - environment building process & solving problems encountered
2022-07-01 19:04:00 【flashinggg】
Catalog
2 Installing a plug-in Live Server
4 Open the job frame to view the model
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead
Homework 0 The model does not show
1 download Visual Studio Code
Click the link directly to download and install :
Download Visual Studio Code - Mac, Linux, Windows
2 Installing a plug-in Live Server
open VS Code -> Extensions -> Search for Live Server -> Click on install Can be installed

Digression :VS Code The installed plug-ins can be found in C disc -> Users -> user name -> .vscode Found in the folder .

3 Node.js
Click the link to download and install Node.js:
Download | Node.js (nodejs.org)
(1)Win+R Call up the operation column and enter cmd:

Or search directly in the search box cmd Fine :

(2) Enter the following command :
npm install http-server -g

The appearance of the above interface means install succeed , If The error report appears WARN, The following part talks about the solution , You can go and have a look directly .
4 Open the job frame to view the model
(1) stay VS Code choice Open new fold And choose an assignment 0 Folder , Open it as follows :

(2) Right click index.html File and select Open with Live Server:


You can successfully open the contents of the job framework , It includes : A character model and A light source moving around the model .
If you open it, there is a black screen or there is only a light source without a model , There are solutions to the following problems .
solve the problem
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead
This question will be input npm install http-server -g when , If the following error message appears :
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

First , Guarantee npm Updated to the latest version . after , Find us to install Noder.js Folder , I installed it to D disc , Just follow your save path ,
And open them separately npm and npm.cmd These two documents .

Files can be directly dragged into the just installed VS Code You can open it in .
ctrl+H Search separately and locate
prefix -gnpm as follows :

npm.cmd as follows :

Here's the key step , Separate prefix -g Replace with the following code :( Note that the replacement here is best entered manually !)
prefix --location=globalAfter replacement npm and npm.cmd As follows :


ctrl+s Save separately and close the file , Proceed again cmd Input npm install http-server -g, You'll find what just happened WARN It disappeared .
Homework 0 The model does not show
Homework 0 Only light source / Homework 0 The model does not show / Homework 0 Black screen ... And so on, you can try the next solution :
What I started with was the problem of black screen , Light source and model have nothing , Only the operation bar in the upper right corner

This can be found in the displayed browser , Press F12 You can pop up the browser background Console Interface :

See the hint :
Uncaught ReferenceError: mat4 is not defined
Let's go back to VS Code Open frame , Observe index.html Documents can be found , in the light of mat4 It is this sentence :

I think this link is loading mat4 Part of :https://cdnjs.cloudflare.com/ajax/libs/gl-matrix/2.8.1/gl-matrix-min.js
I find , I can't open this link inside , Even if the ladder is hung, it cannot be opened ... So I came up with a rough solution , Direct download gl-matrix-min.js The document is added to the frame , It should be able to solve .
After searching, I found that someone uploaded this file github:gl-matrix-min.js · GitHub
Click in and download directly , And drag the corresponding file in the file into VS Code Just inside , I put it on src Next :


It's not finished yet , You also need to put the original code just :
<script src="https://cdnjs.cloudflare.com/ajax/libs/gl-matrix/2.8.1/gl-matrix-min.js"
integrity="sha512-zhHQR0/H5SEBL3Wn6yYSaTTZej12z0hVZKOv3TwCUXT1z5qeqGcXJLLrbERYRScEDDpYIJhPC1fk31gqR783iQ=="
crossorigin="anonymous" defer> </script>
Replace with :
<script src="src/gl-matrix-min.js" defer> </script>After doing the above ,ctrl+s preservation , Refresh the results page , The model can be found and displayed , And the error report is eliminated .

If the model is not fully displayed , There was only one 202, Refresh a few more times and it will come out .
边栏推荐
- 11. Users, groups, and permissions (1)
- How does factor analysis calculate weights?
- Leetcode203 remove linked list elements
- 斯坦福、Salesforce|MaskViT:蒙面视觉预训练用于视频预测
- Technology implementation and Architecture Practice
- R语言ggplot2可视化:gganimate创建动态柱状图动画(gif)、在动画中沿给定维度逐步显示柱状图、enter_grow函数和enter_fade函数控制运动内插退出(渐变tweening)
- Leetcode-160 intersecting linked list
- OpenAI|视频预训练 (VPT):基于观看未标记的在线视频的行动学习
- Lumiprobe 自由基分析丨H2DCFDA说明书
- R language epidisplay package ordinal or. The display function obtains the summary statistical information of the ordered logistic regression model (the odds ratio and its confidence interval correspo
猜你喜欢

Intensive cultivation of channels for joint development Fuxin and Weishi Jiajie held a new product training conference

11、用户、组和权限(1)

Leetcode-128 longest continuous sequence

华为游戏初始化init失败,返回错误码907135000

Lumiprobe 双功能交联剂丨Sulfo-Cyanine5 双-NHS 酯

Lumiprobe 自由基分析丨H2DCFDA说明书

1. "Create your own NFT collections and publish a Web3 application to show them." what is NFT

Why do independent website sellers start to do social media marketing? The original customer conversion rate can be improved so much!

Mise en place d'une plate - forme générale de surveillance et d'alarme, quelles sont les conceptions nécessaires dans l'architecture?

搭建一個通用監控告警平臺,架構上需要有哪些設計
随机推荐
Leetcode-141 circular linked list
华为联机对战服务玩家掉线重连案例总结
搭建一個通用監控告警平臺,架構上需要有哪些設計
R language uses the aggregate function of epidisplay package to divide numerical variables into different subsets based on factor variables, and calculate the summary statistics of each subset
R language uses the transmute function of dplyr package to calculate the moving window mean value of the specified data column in dataframe data, and uses ggplot2 package to visualize the line graph b
Case study on comprehensive competitiveness of principal components
Memo - about C # generating barcode for goods
Leetcode-21 combines two ordered linked lists
R language uses the DOTPLOT function of epidisplay package to visualize the frequency of data points in different intervals in the form of point graph, and uses PCH parameters to customize the shape o
实现一个Prometheus exporter
How does factor analysis calculate weights?
Write an open source, convenient and fast database document query and generation tool with WPF
1. "Create your own NFT collections and publish a Web3 application to show them." what is NFT
Create your own NFT collections and publish a Web3 application to show them (Introduction)
The R language uses the tablestack function of epidisplay package to make statistical summary tables (descriptive statistics based on the grouping of target variables, hypothesis testing, etc.). If th
R语言ggplot2可视化:gganimate创建动态柱状图动画(gif)、在动画中沿给定维度逐步显示柱状图、enter_grow函数和enter_fade函数控制运动内插退出(渐变tweening)
如何运营好技术相关的自媒体?
LiveData postValue会“丢”数据
力扣每日一题-第32天-1232. 缀点成线
R language ggplot2 visualization: visualize the line graph and add customized Y-axis label information to the line graph using the labels function