More than one 3D scene on the same HTML page without iframes

Home Forums General Questions More than one 3D scene on the same HTML page without iframes

This topic contains 6 replies, has 2 voices, and was last updated by Avatar scalare 1 week, 3 days ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #20003
    Avatar
    scalare
    Licensee

    Hi Verge3D Team!

    Is it possible to have more than one 3D Scene inserted into an HTML page without the use of iframes? If so, how? I’m working on a website where we need to display several 3D objects that will have to rotate slightly based on mouse position on the containing page. Is this something we can do with Verge3D with a separate GLTF file/visual logic file per object, and insert them into different locations on the same page? If so, how?

    Thank you!

    #20017
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    Hi,

    Yes you can have multiple app instances on the same page loading its own gltf file each. However, for now you can have only one logic file per html. :unsure:

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #20036
    Avatar
    scalare
    Licensee

    Hi Yuri,

    I’m confused by your answer. Does that mean that we can display different gltf 3d objects on a page, but only one of them will react to the mouse movement, because only one of them can be controlled via puzzles?

    The case is that we need about 4 or 5 different objects on the page, that will change their position responsively, something that we cannot do easily by adjusting the objects positions in a single scene, because we need them to match the positions of some HTML background elements (it is much easier to have each object as a separate GLTF and position them absolutely, matching the background automatic resize for the various responsive breakpoints)

    Can you please clarify?

    #20041
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    will react to the mouse movement, because only one of them can be controlled via puzzles?

    if we are talking about default camera controls, then yes, all app instances will react to mouse movement. We didn’t try such a setup with puzzles and I’m not sure how it will behave. May be you could give it a try and see what happens?

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #20045
    Avatar
    scalare
    Licensee

    Not really. I plan to have several small 3D scenes in the same page, say about 250×250 pixels each. And I want them to react to the mouse movement that won’t necessarily hover over the 3D scenes, so we’re not talking about default camera controls here. I want the objects to rotate SLIGHTLY, following the cursor movement, so I guess I need to create some puzzles that will get the mouse location in every frame, and make the objects rotate in a non-linear calculation. But I guess that is not possible because I cannot have more than one visual logic on the same page, and that is what I would need. Am I right?

    #20047
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    yes, I think you’ll have to use JavaScript in such the case

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #20089
    Avatar
    scalare
    Licensee

    Thanks, I’ll try and see how that goes.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.