Jump to content

Color Picker Animation


DylanD
 Share

Recommended Posts

Hey everyone,

I was wondering if there was a way for me to have the color picker's outer ring slowly changing then I get the value of it and I have a nice radiantly changing material.  

But I'm not sure how to make the color picker change without changing the value.  Any ideas?

https://www.babylonjs-playground.com/#91I2RE#89

 

To be more clear I want to be able to set the value of the color picker then the outer ring slowly moves from the color I set it as.  All from code nothing through the Gui.  As in I don't want the color picker to be seen either(which I can do).

Link to comment
Share on other sites

4 minutes ago, brianzinn said:

Sounds like you do not need to use the color picker at all.  Can you not just animate the color yourself on a material?
BABYLON.Animation.ANIMATIONTYPE_COLOR3
https://www.babylonjs-playground.com/#JY35MD#3

although I don't fully understand this yet, I do believe you have the right idea.  Thanks! I will look into this

 

I was originally just making the color and using periodic function to make it loop but I think this will be better.

Link to comment
Share on other sites

I did give you an unnecessarily complicated PG, as it was changing the light and not the material.  Here is a simpler PG that is not looping:

Material goes from Red to Yellow.  
https://www.babylonjs-playground.com/#1HECPU#68

if you are using BabylonJS 3.3, you can use promises instead of callback.

var anim = scene.beginAnimation(...);
await anim.waitAsync();

 

Link to comment
Share on other sites

5 minutes ago, brianzinn said:

I did give you an unnecessarily complicated PG, as it was changing the light and not the material.  Here is a simpler PG that is not looping:

Material goes from Red to Yellow.  
https://www.babylonjs-playground.com/#1HECPU#68

if you are using BabylonJS 3.3, you can use promises instead of callback.


var anim = scene.beginAnimation(...);
await anim.waitAsync();

 

Thanks, I'm still figuring everything out.  Thanks for the help!

This scene is way easier to understand.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...