Fadeout for objects

Home Forums Programming Fadeout for objects

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #23740
    Avatarmugga
    Newbie

    Is it possible to fade out and object with puzzle/js function?

    The only way I would know of at the moment is, exporting a variable for the used material on the object which controls the opacity/transparency.

    #23748
    Yuri KovelenovYuri Kovelenov
    Developer

    yes, this is the right way to go!

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

    #23776
    Avatarmugga
    Newbie

    Okay. Is there another maybe simpler possibility to do a fadeout?
    On a pure programmatically way, instead of “re-exporting” the 3d file with proper setup material?

    #23805
    Yuri KovelenovYuri Kovelenov
    Developer

    sure, you can use the animate param puzzle (or the underlying JavaScript) for that
    https://www.soft8soft.com/docs/manual/en/puzzles/Animation.html#animate_param

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

    #23820
    Avatarmugga
    Newbie

    But how you do that? I havent seen anything like transparency. In order to change a value, I have to first set it in 3d.

    Maybe to be more clear of what I would like to achieve. I would like to fadeout a group or an object with just using javascript. Just as simple as in jquery for example would be great:
    $("#object").fadeOut();

    • This reply was modified 1 month, 2 weeks ago by Avatarmugga.
    #24189
    Avatarweb
    Licensee

    I would also be interested in a simple way of fading out geometry/objects programmatically. Without setting up objects with proper material settings in 3d

    #24200
    Yuri KovelenovYuri Kovelenov
    Developer

    well, you might try doing it three.js way, something like

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

    #24221
    Avatarweb
    Licensee

    For “object” I can just insert the name of the 3d object, correct?

    When I’m doing it this way I just get javascript error “cannot set property ‘transparent’ of undefined”

    #24260
    Yuri KovelenovYuri Kovelenov
    Developer

    You should get object first
    var object = app.scene.getObjectByName( "objectName" );

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

    #24396
    Avatarweb
    Licensee

    Doesnt work for me. Tried it on directly in the “prepareExternalInterface” with the code how you wrote:

    And also tried it the way I would like to have it:
    Custom functions in my “visuallogic.js”

    And execute it in my “normal app js” in “prepareExternalInterface”:
    v3d.puzzles.procedures.fadeGeo("Testgeo");

    #24411
    Yuri KovelenovYuri Kovelenov
    Developer

    I forgot to mention that materials should also be created with code:

    object.material = new v3d.MeshPhongMaterial({ color: '#00BB00', emissive: '#550000' });

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

    #24446
    GlifTekGlifTek
    Licensee

    hi Web.

    I’ve been wrestling with this one for quite a long time.
    I’ve come up with a number of workarounds.

    since there’s no “entire object opacity” .. (yet..grumble..)..
    ahem… B-)
    one path is to make the entire object ONE MATERIAL.. and use RGB paint values to differentiate subsets of the material that act as different materials.

    like here…
    actually sorry I’m afraid to post a link since the forum ritually erases my posts when i post links .
    https://www.soft8soft.com/docs/manual/en/introduction/Optimizing-WebGL-performance.html#Vertex_Colors
    …so look in the VERTEX COLORS section of the “Optimization Techniques” of the user manual. there’s a lot of power in that.
    when done like that.. you can use one value node to determine the opacity of the entire object if it’s all one material.
    i even went so far as to create an elaborate dynamic conditional if/then node network that takes RGB values.. converts them to RGBA values through a recommended formula then gives you freedom to use 25 or so decimal values of each channel (r/g/b/.. for different material nodes.. so it’s quite a range.

    I’ve been meaning to post that on github for people to use.. it’s been on the back burner while i get other things taken care of before needing it..

    I’m actually delving back into it now so I’ll put it up soon.

    ANOTHER WAY is.. one thing that myself and a few others have requested and are psyched that it’s here in v3d v3… is the OBJECT option in the Texture Coordinate node.

    using spherical (radial) texture to parse transparency, you can fade an entire object with multiple materials.

    i forgot how i did it.. and will have to dig it up ..doing that NOW actually…
    because i need it now…
    it’s using an empty that is linked to all the material’s transparency controlling values.. and when the empty is moved.. ALL the transparencies adjust at once..

    similar to what you see in Branden’s moving image in this link… (not hot linking cuz forum) …

    Object output for Texture Coordinate node

    I’ll keep you updated as i rummage through my old experiments (hope i named them easy to identify…) cuz this is a challenge I’ve been repeatedly coming back to as i have MANY objects that all need to fade all at once.
    :good:

    • This reply was modified 1 month ago by GlifTekGlifTek.
    #24448
    GlifTekGlifTek
    Licensee

    yup/.. and i just wrote a huge post and it’s gone…

    i cannot believe this. it was a page long.

    #24495
    Yuri KovelenovYuri Kovelenov
    Developer

    Sorry for the hidden post. It was the spam plugin false positive.

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

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

You must be logged in to reply to this topic.