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.

Can we save position / rotation in Verge published file

Home Forums General Questions Can we save position / rotation in Verge published file

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #86816
    visualizer
    Customer

    Hi
    I am wondering if there is any feature in puzzle such as save user changes made to geometries like position or rotation by using drag / rotate facility?

    Example – A simple scene with cube drag / rotate. If I drag move or rotate the cube then can it be saved by using puzzles or any means? So next time scene opens it reads from certain file or remain in memory the last session parameters?

    • This topic was modified 1 week, 5 days ago by visualizer.
    #86818

    Hi,

    This is actually a very good question! There are different methods of preserving state of Verge3D-based applications:

    1) Storing data in URL params. Data is saved by the open web page puzzle with replace URL (no reload) option, which in turn gets a URL generated by the set url param puzzle. To retrieve the data use the get URL data puzzle with parameters option.

    2) Storing data in browser local storage. See the storage set / storage get puzzles.

    3) Storing data on web server. This would require authenticating your users. The easiest way to achieve that would be using cloud-based backends such as Firebase. In fact, Verge3D 4.12 is made fully compatible with such solutions. We’re preparing a how-to guide explaining how to integrate Verge3D with Firebase, so stay tuned!

    Which one to chose depends on your situation. Methods 1 and 2 are very easy to implement, but 3 is the standard approach.

    Soft8Soft Tech Chief
    Want more Verge3D updates? Follow me on X, Facebook, or LinkedIn

    #86820
    visualizer
    Customer

    Excellent to know that our most loved Verge is getting more robust and futuristic.
    Interesting.
    I will check the references.
    Thank you :good: very much for guidance points !

    #86821
    saurav
    Participant

    Is there any method to save the changed colour or texture of an object in Verge3D?

    #86822

    Is there any method to save the changed colour or texture of an object in Verge3D?

    Sure, the same methods I mentioned earlier should work just fine. For the texture there is an additional method based on the file storage capabilities of Verge3D for WordPress plugin. See the Custom Image example in the Asset Store.

    Soft8Soft Tech Chief
    Want more Verge3D updates? Follow me on X, Facebook, or LinkedIn

    #86824
    saurav
    Participant

    I tried to implement puzzles with set URL and get URL method as well as set storage and get storage, but it is not working, what could be the issue?

    #86830

    I tried to implement puzzles with set URL and get URL method as well as set storage and get storage, but it is not working, what could be the issue?

    For URL params there should be key-value pairs where key is the name of the value to store. Once you get “parameters” you should extract individual keys with dict get key. Also, the 0.1s timer appears to be useless. You should extract parameters explicitly, e.g. during the app load or by pressing to some button, etc.

    For the storage set/get example you should explicitly define what you store and what you extract. Again, timer appears to be useless.

    In any case try to debug your snippet.

    Soft8Soft Tech Chief
    Want more Verge3D updates? Follow me on X, Facebook, or LinkedIn

    #86862
    saurav
    Participant

    Thank you for guidance. It worked fine now!

    • This reply was modified 1 week, 2 days ago by saurav.
    #86864
    saurav
    Participant

    The scene works fine as long as the tab is open but when we close the tab and reopen the file, the original positions get reset. What shall be done to save the change permanently?
    Do we have to create an external file where the data will be saved and read from?

    #86868

    The scene works fine as long as the tab is open but when we close the tab and reopen the file, the original positions get reset. What shall be done to save the change permanently?

    If it’s about saving data in the URL, you should specify full path, not just HTML to make the app work.

    Do we have to create an external file where the data will be saved and read from?

    It’s possible for sure, though might not be very convenient for the users.

    Soft8Soft Tech Chief
    Want more Verge3D updates? Follow me on X, Facebook, or LinkedIn

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