国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

純代碼的3D玫瑰花,有個這個還怕女朋友不開心?

這篇具有很好參考價值的文章主要介紹了純代碼的3D玫瑰花,有個這個還怕女朋友不開心?。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

先上效果圖:
純代碼的3D玫瑰花,有個這個還怕女朋友不開心?
再上代碼:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        @import url("https://fonts.googleapis.com/css2?family=Niconne&display=swap");
        * {
            margin: 0;
            padding: 0;
        }
        body {
            position: relative;
            width: 100vw;
            height: 100vh;
            background: radial-gradient(circle, #82707a, #24111e 100%);
        }
        main {
            position: relative;
            z-index: 1;
        }
        h1 {
            font-family: "Niconne", cursive;
            font-size: 10vw;
            margin-left: 1rem;
            color: rgba(255, 255, 255, 0.2);
        }
        p {
            position: fixed;
            bottom: 0;
            margin: 10px;
            font-size: max(3.3vw, 15px);
            color: rgba(255, 255, 255, 0.5);
        }
        #filter {

        }
        canvas {
            -moz-user-select: none;
            -webkit-user-select: none;
            -ms-user-select: none;
            user-select: none;
            position: fixed;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            margin: 0;
            padding: 0;
            z-index: 0;
        }
        header {
            position: fixed;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 0 1% 1%;
            width: 100%;
            z-index: 3;
            height: 7em;
            font-family: "Bebas Neue", sans-serif;
            font-size: clamp(0.66rem, 2vw, 1rem);
            letter-spacing: 0.5em;
        }

        a{
            color: black;
            text-decoration: none;
        }
    </style>
</head>
<body>
<main>
    <h1></h1>
    <p></p>
</main>
<header>
    <div>Animated Sections</div>
    <div><a href="https://blog.csdn.net/qq_35241329?type=blog">Original By TiMi先生</a></div>
</header>
<div id="filter"></div>
<script async src="https://ga.jspm.io/npm:es-module-shims@1.6.3/dist/es-module-shims.js" crossorigin="anonymous"></script>
<script type="importmap">
  {
    "imports": {
      "three": "https://unpkg.com/three@0.150.1/build/three.module.js",
      "three/addons/": "https://unpkg.com/three@0.150.1/examples/jsm/"
    }
  }
</script>
</body>
<script type="module">
    import * as THREE from "three";
    import { OrbitControls } from "three/addons/controls/OrbitControls.js";
    import { OBJLoader } from "three/addons/loaders/OBJLoader.js";

    let container;
    let camera, scene, renderer, controls;
    let manager;
    let object;
    let material = new THREE.MeshStandardMaterial({
        metalness: 0,
        roughness: 0.8,
        side: THREE.DoubleSide
    });

    init();
    animate();

    function init() {
        container = document.createElement("div");
        document.body.appendChild(container);

        camera = new THREE.PerspectiveCamera(
            33, //45
            window.innerWidth / window.innerHeight,
            1,
            2000
        );
        camera.position.y = 150;
        camera.position.z = 250;

        scene = new THREE.Scene();

        const ambientLight = new THREE.AmbientLight(0xffffff, 0.1);
        scene.add(ambientLight);

        const pointLight = new THREE.PointLight(0xffffff, 0.5);
        pointLight.castShadow = true;
        camera.add(pointLight);
        scene.add(camera);

        // manager
        function loadModel() {
            object.traverse(function (child) {
                if (child.isMesh) {
                    if (child.name == "rose") {
                        material = material.clone();
                        material.color.set("crimson");
                    } else if (child.name == "calyx") {
                        material = material.clone();
                        material.color.set("#001a14");
                    } else if (child.name == "leaf1" || child.name == "leaf2") {
                        material = material.clone();
                        material.color.set("#00331b");
                    }
                    child.material = material;
                }
            });
            object.rotation.set(0, Math.PI / 1.7, 0);
            object.receiveShadow = true;
            object.castShadow = true;
            scene.add(object);
        }

        manager = new THREE.LoadingManager(loadModel);

        // model
        function onProgress(xhr) {
            if (xhr.lengthComputable) {
                const percentComplete = (xhr.loaded / xhr.total) * 100;
            }
        }
        function onError() {}

        const loader = new OBJLoader(manager);
        loader.load(
            "https://happy358.github.io/Images/Model/red_rose3.obj",
            function (obj) {
                object = obj;
            },
            onProgress,
            onError
        );

        renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });

        renderer.setPixelRatio(window.devicePixelRatio);
        renderer.setSize(window.innerWidth, window.innerHeight);
        renderer.outputEncoding = THREE.sRGBEncoding;
        renderer.shadowMap.enabled = true;
        container.appendChild(renderer.domElement);

        controls = new OrbitControls(camera, renderer.domElement);
        controls.autoRotate = true; //true
        controls.autoRotateSpeed = 2;
        controls.enableDamping = true;
        controls.enablePan = false;
        controls.minPolarAngle = 0;
        controls.maxPolarAngle = Math.PI / 2;
        controls.target.set(0, 0, 0);
        controls.update();

        window.addEventListener("resize", onWindowResize);
    }
    function onWindowResize() {
        camera.aspect = window.innerWidth / window.innerHeight;
        camera.updateProjectionMatrix();
        renderer.setSize(window.innerWidth, window.innerHeight);
    }

    function animate() {
        requestAnimationFrame(animate);
        controls.update();
        render();
    }
    function render() {
        renderer.render(scene, camera);
    }

</script>
</html>

最近截的動圖好多都大于5M無法上傳了,有沒有比較好的視頻轉gif的工具推薦以下。文章來源地址http://www.zghlxwxcb.cn/news/detail-447776.html

到了這里,關于純代碼的3D玫瑰花,有個這個還怕女朋友不開心?的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。如若轉載,請注明出處: 如若內容造成侵權/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領支付寶紅包贊助服務器費用

相關文章

  • python寫玫瑰花代碼

    python寫玫瑰花代碼

    路漫漫其修遠兮,吾將上下而求索 馬上情人節(jié)了,今天讓我們在電腦電腦上創(chuàng)建一朵玫瑰花,送你,送你想送的人。話不多說,直接來。 只要改掉代碼中的某某某成自己想給的人的名字即可。 ?情人節(jié)送的代碼,這不上火,哈哈???? 謝謝觀看

    2024年02月08日
    瀏覽(24)
  • 玫瑰花動態(tài)代碼html(可直接復制)

    玫瑰花動態(tài)代碼html(可直接復制)

    !DOCTYPE html html head meta charset=\\\"UTF-8\\\" title玫瑰/title style type=\\\"text/css\\\" #shusheng { position: absolute; width: 100%; height: 100%; text-align: center; } /style /head body div style=\\\"text-align: center\\\" /div div id=\\\"shusheng\\\" canvas id=\\\"c\\\"/canvas script var b = document.body; var c = document.getElementsByTagName(\\\'canvas\\\')[0]; var a = c.getContex

    2024年02月06日
    瀏覽(17)
  • Python繪制玫瑰花完整代碼?發(fā)妹紙用

    在Python中,我們可以使用matplotlib和numpy庫來創(chuàng)建三維圖形。在這篇文章中,我們將介紹如何使用這些庫來繪制一個立體的玫瑰花。讓我們開始吧! 在開始之前,請確保您的計算機上已安裝Python和matplotlib庫。您可以使用以下命令來安裝matplotlib: 以下代碼將使用matplotlib庫來繪

    2024年02月07日
    瀏覽(22)
  • ?草莓熊python turtle繪圖代碼(玫瑰花版)附源代碼

    ?草莓熊python turtle繪圖代碼(玫瑰花版)附源代碼

    本文目錄: 一、前言 二、草莓熊手持玫瑰花成品效果圖 三、代碼演示方法和代碼命令解釋 四、草莓熊手持的玫瑰花源代碼 五、相關資源圖片 六、我的“草莓熊python turtle繪圖(玫瑰花版)”繪圖源代碼 七、草莓熊python turtle繪圖(風車版)附源代碼 八、怎么才能正常運行

    2024年02月02日
    瀏覽(28)
  • 【Python Turtle合集】有趣好玩的代碼當然要分享給大家啦~(皮卡丘、玫瑰花、小黃人......)

    【Python Turtle合集】有趣好玩的代碼當然要分享給大家啦~(皮卡丘、玫瑰花、小黃人......)

    ?? 作者 :“程序員梨子” ?? **文章簡介 **:本篇文章主要是寫了利用Turtle庫繪制四種不一樣的圖案的小程序! ?? **文章源碼免費獲取 : 為了感謝每一個關注我的小可愛??每篇文章的項目源碼都是無 償分享滴?????????? 點這里藍色這行字體自取,需要什么源碼記得

    2023年04月13日
    瀏覽(27)
  • Python玫瑰花

    Python玫瑰花

    序號 文章目錄 直達鏈接 1 浪漫520表白代碼 https://want595.blog.csdn.net/article/details/130666881 2 滿屏表白代碼 https://want595.blog.csdn.net/article/details/129794518 3 跳動的愛心 https://want595.blog.csdn.net/article/details/129503123 4 漂浮愛心 https://want595.blog.csdn.net/article/details/128808630 5 愛心光波 https://wa

    2024年02月08日
    瀏覽(20)
  • Python繪制玫瑰花

    前言 一、第一種畫法 二、第二種畫法 總結 今天我們來畫一朵玫瑰花。 這應該是最好看玫瑰花了。 第二種就稍遜一籌了,但也挺好看。 所畫玫瑰花的庫用的只是turtle,但代碼卻很多。

    2024年02月05日
    瀏覽(19)
  • python繪制立體玫瑰花

    python繪制立體玫瑰花

    2024年02月08日
    瀏覽(23)
  • 【Python炫酷系列】這個3D星空好有趣(完整代碼)

    【Python炫酷系列】這個3D星空好有趣(完整代碼)

    python3.11.4及以上版本 PyCharm Community Edition 2023.2.5 pyinstaller6.2.0 ( 可選 ,這個庫用于打包,使程序沒有python環(huán)境也可以運行,如果想發(fā)給好朋友的話需要這個庫哦~) 【注】 python環(huán)境搭建請見:https://want595.blog.csdn.net/article/details/134586653 pyinstaller使用教程見:h

    2024年02月03日
    瀏覽(25)
  • 寫給女朋友的動態(tài)愛心代碼html(可修改名字)

    寫給女朋友的動態(tài)愛心代碼html(可修改名字)

    寫給女朋友的愛心代碼html(可修改名字) 桌面新建一個txt文件,把代碼復制進去,再把后綴改成.html

    2024年02月04日
    瀏覽(28)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領取紅包,優(yōu)惠每天領

二維碼1

領取紅包

二維碼2

領紅包