首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏前端专享

    如何使用 react 和 three.js 在网站渲染自己的3D模型

    create-react-app my-3d-model #or yarn create react-app my-3d-model 然后安装 @react-three/fiber 和 @react-three/drei npm install three @react-three/fiber @react-three/drei #or yarn add three @react-three/fiber @react-three /drei 将模型转换为 React 组件 完成之后,继续并运行以下命令,使用 gltfjsx 转换成 react 组件格式。 model.glb 转换后的内容类似于以下代码 import React, { useRef } from 'react' import { useGLTF } from '@react-three/drei from 'react' import { Canvas } from '@react-three/fiber' import { OrbitControls } from '@react-three/drei

    10.1K10编辑于 2022-03-30
  • 来自专栏大师级码师

    python常用字典操作范例

    start of a german to english dictionary D1['null'] = 'zero' D1['eins'] = 'one' D1['zwei'] = 'two' D1['drei "Length = ",len(D1) find the value by key (does not change dictionary) print "The english word for drei is ", D1['drei'] better if 'drei' in D1: print "The english word for drei is ", D1['drei'] create '] for no change e3 = D2.pop('drei') print "Extract value for key = 'drei' and delete item from dictionary :" print e3 print "Dictionary D2 after 'drei' has been popped:" print D2 print str1 = "I still miss you

    36010发布于 2021-11-02
  • 来自专栏Java小王子

    python常用字典操作范例

    start of a german to english dictionary D1['null'] = 'zero' D1['eins'] = 'one' D1['zwei'] = 'two' D1['drei "Length = ",len(D1) find the value by key (does not change dictionary) print "The english word for drei is ", D1['drei'] better if 'drei' in D1: print "The english word for drei is ", D1['drei'] create '] for no change e3 = D2.pop('drei') print "Extract value for key = 'drei' and delete item from dictionary :" print e3 print "Dictionary D2 after 'drei' has been popped:" print D2 print str1 = "I still miss you

    32820发布于 2021-11-01
  • 来自专栏若尘的技术专栏

    Python 持久化 - 文件

    (r"shv.db") try: k1 = shv['one'] print(k1) finally: shv.close() {'eins': 1, 'zwei': 2, 'drei ': 3} {'eins': 1, 'zwei': 2, 'drei': 3} # shelve 忘记写回,需要使用强制写回 shv = shelve.open(r"shv.db", writeback (r"shv.db") try: k1 = shv['one'] print(k1) finally: shv.close() {'eins': 1, 'zwei': 2, 'drei ': 3} {'eins': 100, 'zwei': 2, 'drei': 3} # shelve 使用with管理上下文环境 with shelve.open(r'shv.db', writeback ': 3} {'eins': 1000, 'zwei': 2, 'drei': 3}

    1.3K87发布于 2021-05-11
  • 来自专栏网络安全技术点滴分享

    Three.js实例化技术:高效渲染数千3D对象

    使用drei/instances可以快速实现实例化:import { Instance, Instances } from "@react-three/drei"const boxCount = 1000function 多组实例要渲染森林场景,可能需要不同的实例组:import { createInstances } from "@react-three/drei"const boxCount = 1000const

    34410编辑于 2025-08-17
  • 来自专栏杂谈

    3D个人简历网站 5.天空、鸟、飞机

    Sky.jsx // 从 React 库中导入 useRef 钩子,用于创建可变的 ref 对象 import { useRef } from "react"; // 从 @react-three/drei 库中导入 useGLTF 钩子,用于加载 GLTF 格式的 3D 模型 import { useGLTF } from "@react-three/drei"; // 从 @react-three/fiber / useFrame 用于在每一帧渲染时执行代码,常用于实现动画效果 import { useFrame } from "@react-three/fiber"; // 从 @react-three/drei GLTF 格式的 3D 模型 // useAnimations 用于管理 3D 模型的动画 import { useAnimations, useGLTF } from "@react-three/drei useRef 用于创建可变的 ref 对象,可在组件的整个生命周期内保持值 import { useEffect, useRef } from "react"; // 从 @react-three/drei

    13910编辑于 2025-12-31
  • 来自专栏python3

    Python中字典dict

    print(d['on333']) KeyError: 'on333' # fromkeys: 使用指定的序列作为键,使用一个值作为字典的所有的键的值 l = ["eins", "zwei", "drei fromkeys的调用主体 d = dict.fromkeys(l, "hahahahahah") print(d) {'eins': 'hahahahahah', 'zwei': 'hahahahahah', 'drei

    1.4K20发布于 2020-01-20
  • 来自专栏若尘的技术专栏

    python内置数据结构list、set、dict、tuple(一)

    expected 2) # 双层列表循环变异 # a为嵌套列表,或者叫双层列表 a = [["one", 1, "enis"], ["two", 2, "zwei"], ["three", 3, "drei 的个数应该跟解包出来的变量个数一致 for k,v,w in a: print(k, "--", v, "--", w) one -- 1 -- enis two -- 2 -- zwei three -- 3 -- drei

    1.2K107发布于 2021-02-23
  • 来自专栏刘悦的技术博客

    红袖添香,绝代妖娆,Ruby语言基础入门教程之Ruby3基础数据类型(data types)EP02

    true     也可以使用size或者length方法,判断哈希的大小是否为0: dictionary = { "one" => "eins", "two" => "zwei", "three" => "drei ---- false false     通过delete方法删除键值对: dictionary = { "one" => "eins", "two" => "zwei", "three" => "drei " } dictionary.delete("one") puts dictionary # ---- 输出结果 ---- {"two"=>"zwei", "three"=>"drei"}     需要注意的是

    2.1K20编辑于 2022-10-28
  • 来自专栏锤子代码

    美团发布千亿大模型,效果如何?

    正确,小明手上有6个水果和3个蔬菜 3. gisteren私はcomió три 햄버거,chaque расходы me drei долар,மொத்தம் เท่าไร novac?

    22610编辑于 2025-09-02
  • 使用React-Three-Fiber创建动态图像动画:从3D几何到纹理映射的完整指南

    /Banner/Banner';import { View } from '@/webgl/View';import { PerspectiveCamera } from '@react-three/drei

    41510编辑于 2025-09-04
  • 来自专栏python3

    python的元祖,集合,字典的常见函数

    In [81]: d xxxxxxxxxx # fromkeys:使用指定的序列作为键,使用一个值作为字典的所有的键的值 l = ["eins","zwei","drei"] # 注意 fromkeys # 注意 fromkeys 的调用主体 d = dict.fromkeys(l,"heheheh") print(d) {'eins': 'heheheh', 'zwei': 'heheheh', 'drei

    1.8K20发布于 2020-01-19
  • 来自专栏杂谈

    3D个人简历网站 4.小岛

    useRef 钩子,useEffect 用于处理副作用,useRef 用于创建可变引用 import { useEffect, useRef } from "react"; // 从 @react-three/drei 库导入 useGLTF 钩子,用于加载 glTF 模型 import { useGLTF } from "@react-three/drei"; // 从 @react-three/fiber 库导入

    16410编辑于 2025-12-31
  • 来自专栏大数据智能实战

    Attention is all you need新翻译架构的测试

    Wie funktioniert das also - expected: So how does it happen - got: So how does it work - source: Drei will they desire - got: What are they going to consume What are <UNK> - source: Was werden diese drei expected: So we talk about a  a batter who bats - got: We talk about a <UNK> every cell - source: Drei - expected: He kept pointing here - got: And he always showed here - source: Und sie sagte die drei - expected: This is happening to us today - got: This is what we talk today - source: Wir haben drei

    1.6K80发布于 2018-01-09
  • 来自专栏码农沉思录

    20年逆袭5G之首!论团战,没人打得过中国通信!

    和记电讯奥地利公司Drei Austria与中国设备商开展的5G Bee-o-Meter试点,可以进行实时/每日的工蜂、雄蜂、蜂王的种类识别及各类蜜蜂飞出和飞入的精确统计。

    59110发布于 2020-03-06
领券