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.

Home Forums Official Announcements Verge3D 2.12 pre2 available!

Viewing 9 posts - 46 through 54 (of 54 total)
  • Author
    Posts
  • #14236
    scalare
    Customer

    I think I was doing this wrong, by assuming that I would be able to get the window width, when in fact, the get_attr puzzle is expecting an element ID, and I don’t have an ID for the window. So I changed the approach and used an element that does have an ID, and its width changes along with the browser window, but even so, I get an undefined value in the console. Does the “width” property have to be specified in the HTML markup for it to return a value? And would this work with a div or just specific HTML elements, like canvas, inputs, etc?

    Thank you again!

    #14244

    try this one: offsetWidth

    Chief 3D Verger | LinkedIn | Twitter

    #14290
    scalare
    Customer

    Thanks, Yuri. offsetWidth worked perfectly!

    #14425
    elk
    Customer

    “render next frame” puzzle

    Great idea! We were thinking about this too. :good:

    I am trying to build this functionality in puzzles myself for now, and I noticed a thing that would help is if there was a “Is Renderer Enabled” kind of puzzle. I am now setting variables to keep a record of when i set and disabled the renderer, and this is pron to errors. Haven’t checked if this is possible in code yet, but having it in puzzles would be a great edition for testing the rendering logic, so I thought i would suggest it anyway.

    #14445

    thanks for suggestion! we’ll think about it

    Chief 3D Verger | LinkedIn | Twitter

    #14763
    jem
    Customer

    Hey Elk,
    Were you able to implement your re-render upon going full screen function? I am experiencing the same behavior. If you have solution, would you mind sharing? Many thanks, Jem.

    Jeremy Wernick

    #14785

    Hi Jem,

    you can use the resize event listener to handle entering the full screen mode:

    disable rendering window resize

    Attachments:
    You must be logged in to view attached files.

    Chief 3D Verger | LinkedIn | Twitter

    #14791
    elk
    Customer

    Hi jem

    I did not test this on the fullscreen, but i have this setup witch should be usable for more things, right now i only use it for enabeling and disabeling the render when i hover over and out on an object, so I can enable and disable highlights on the object while in “diabled renderer mode”.

    Not the prettiest of puzzles code, but here is the basic logic;

    When I hover an object i enable the outline(where you might put fullscreen when clicked insted) and then i run a procedure to check if the renderer is currently enabled, if it is we do nothing(bacause the renderer is already runing so we want no change). If it is not enabled we set a variable (renderNext) to indicate we want to render just one frame, and then we set a variable to keep track of the renderers state (renderingEnabled) to true and then actualy enable the renderer.

    Then in an “every frame” puzzle we run the other procedure to check if we should render the next frame than disable again. So we check if renderNext is true and then set it to false, and our renderEnabled variable to false, and disable the rendering.

    This way the one frame rendering should only be triggered when the renderer is disabled, so we don’t incedentaly also disable it when we just trigger the “when hover” event, or click event in your case.

    This is working quite well for me, but it is not very elegant, and I have only tested this in one project so test it if you like at your own perril :)

    Hope this is sort of what you were looking for.

    #14821
    jem
    Customer

    Elk and Yuri,
    Those are great explanations. Those techniques fixed my issue. Although my ultimate solution was closer to Yuri’s suggestion, Elk’s “every frame” loop solution has me thinking about other possibilities… Thank you both for sharing!

    Jeremy Wernick

Viewing 9 posts - 46 through 54 (of 54 total)
  • You must be logged in to reply to this topic.