Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
983 views
in Technique[技术] by (71.8m points)

aframe - a-frame make gltf and obj as obstacles

im new with a-frame, im trying to build a tour using gltf and obj 3d models, i can load it easily and without any issues. my main issue is that i want to make the object i load as obstacles and the user can not pass by, let say for example im making a street with 3d bulding gltf models, i dont want the user to be able to pass tought this 3d building models. so far here is my code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://aframe.io/releases/1.1.0/aframe.min.js"></script>

    <title>Document</title>
</head>
<body>
    <a-scene>
        <a-assets>
            <img src="assets/images/TexturesCom_Wood_PlanksTemple_3x3_1K_albedo.png" id="floor" >
            <a-asset-item id="building-1" src="assets/images/3d/3dbuilding.gltf"></a-asset-item>
</a-assets>
        <a-entity position="0 3 30">
            <a-camera></a-camera>
        </a-entity>
        <a-plane material=  "color: #fff;
                             src: #floor;
                             repeat: 50 50;
                             normal-map : #floor-nrm;
                             normal-texture-repeat: 50 50"
                             
                rotation="-90 0 0"
                scale="1000 1000 1"
                static-body>
        </a-plane >
        <a-entity gltf-model="building-1">
        </a-entity>        
    </a-scene>
</body>
</html>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...