We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

In index.html can not access object in v3d

Home Forums Programming In index.html can not access object in v3d

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #44058
    derekwang0605
    Customer

    In index.html, I tried to search an object by its name but pop up an error obj = undefined and position not existed. Is it possible to get the object name by below?
    <script>
    var scene = new v3d.Scene();
    var camera = new v3d.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);

    var renderer = new v3d.WebGLRenderer();
    renderer.setSize(window.innerWidth, window.innerHeight);
    document.body.appendChild(renderer.domElement);
    var obj = scene.getObjectByName(‘My_HS’);
    console.log(‘obj=’,obj);
    obj.position.x = 5;
    </script>

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.