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.

the incorrect display of CSS3DRenderer objects in PL viewport

Home Forums General Questions the incorrect display of CSS3DRenderer objects in PL viewport

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #64672
    aqiang
    Customer

    I tried using CSS3DRenderer to render an iframe video, and the final result is displayed correctly. However, in the viewport of the Verge3D editor, there is misalignment unless the viewport size is enlarged to almost fullscreen. To solve this issue, I had an idea of adding an event function to the viewport similar to “window.addEventListener(‘resize’, resize)”. Since there is no documentation available for this specific part, I would appreciate any hints or relevant code that could help resolve this problem. I have attached an image showing the misalignment.

    `function makeIframeObject(width, height) {
    const obj = new v3d.Object3D();
    const element = document.createElement(‘iframe’);
    element.style.width = width + ‘px’;
    element.style.height = height + ‘px’;

    var css3dObject = new CSS3DObject(element);
    obj.css3dObject = css3dObject;
    obj.add(css3dObject);

    var material = new v3d.MeshPhongMaterial({
    ———-
    });
    var geometry = new v3d.BoxGeometry(width, height, 1);
    var mesh = new v3d.Mesh(geometry, material);
    mesh.castShadow = true;
    mesh.receiveShadow = true;
    obj.add(mesh);

    return obj;
    }

    • This topic was modified 1 year, 6 months ago by aqiang.
    • This topic was modified 1 year, 6 months ago by aqiang.
    Attachments:
    You must be logged in to view attached files.
    #64680
    kdv
    Participant

    You’ve set the wrong size for mixerContext.rendererCss.
    See this demo https://cdn.soft8soft.com/demo/blender/htmlmixer/htmlmixer.html

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.