小编scy*_*120的帖子

为什么我无法在 Three.js 中投射或接收阴影

我对此很陌生,我正在尝试在我刚刚制作的对象上创建闪电和阴影。正如您在下面的结果图片中看到的那样,它们实际上都没有投射或接收阴影。\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)

three.js

5
推荐指数
1
解决办法
4617
查看次数

格式'%s'需要'*char'类型的参数,但参数2的类型为'int'

当我尝试编译我的程序时,我在标题中收到警告消息,当我在扫描名称和分数后运行它时它就停止了.我在练习使用字符串时遇到过这个问题很多次,但我找不到解决方案.

#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)

c arrays string structure

1
推荐指数
1
解决办法
126
查看次数

标签 统计

arrays ×1

c ×1

string ×1

structure ×1

three.js ×1