我对此很陌生,我正在尝试在我刚刚制作的对象上创建闪电和阴影。正如您在下面的结果图片中看到的那样,它们实际上都没有投射或接收阴影。\n我已经为渲染器启用了阴影映射,并且还为我的所有对象启用了阴影投射和接收。我究竟做错了什么?
\n\n\n\n<head>\n <meta charset=utf-8>\n <title>Three.js Object Tester</title>\n <style>\n body { margin: 0; overflow: hidden; }\n canvas { width: 100%; height: 100% }\n </style>\n</head>\n\n<body>\n\n<script type="module">\n import * as THREE from \'./js-r119/build/three.module.js\';\n import { TrackballControls } from \'./js-r119/examples/jsm/controls/TrackballControls.js\';\n\n var WIDTH, HEIGHT, aspectRatio;\n var renderer;\n var scene, camera;\n var controls;\n var mesh;\n\n init();\n animate();\n function init() {\n HEIGHT = window.innerHeight;\n WIDTH = window.innerWidth;\n aspectRatio = WIDTH / HEIGHT;\n\n renderer = new THREE.WebGLRenderer( { antialias: true } );\n renderer.setSize( WIDTH, HEIGHT );\n …Run Code Online (Sandbox Code Playgroud) 当我尝试编译我的程序时,我在标题中收到警告消息,当我在扫描名称和分数后运行它时它就停止了.我在练习使用字符串时遇到过这个问题很多次,但我找不到解决方案.
#include <stdio.h>
struct students {
char name[20];
int score[20];
} student;
int main() {
int i, n;
printf("Number of students:\n");
scanf("%d", &n);
for(i=0; i<n; i++) {
printf("Name of the student:\n");
scanf("%s", &student.name[i]);
printf("Score of the student:\n");
scanf("%d", &student.score[i]);
}
for(i=0;i<n;i++) {
if(student.score[i] >= 15) {
printf("%s passed the exam\n", student.name[i]); }
else {
printf("%s failed the exam\n", student.name[i]);
}
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)