Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
First person to guess both the node type and method of changing colors of my Aurora video gets $10 - one guess per person over the next week.. Also see the best method available for spritesheet animations via texture cropping: See here for more: https://youtu.be/NkwwTzoKef0 |
||||
|
See 'API list' for new API for sprite sheet animations: ccbSetTextureCrop(node, ID, cols, rows, imgNu, loop); With this simple line of code can start and stop at any point and easily ensure that you don't go past the last sprite in the animations if you don't want to loop continuously - I had issues with this in default CC method for cloned copies. Best of all can run fast on any number of nodes - just forloop over an array if needed at your specific speed. While looping, if you go past the last sprite will still work fine also. |
||||
|
I guess the node type is a 3d mesh And method of changing colors is through vertex color changing :) |
||||
|
Good try Monks - but nope. |
||||
|
I would have thought vertex colors aswell. Since coppercube ambient and diffuse per mesh node doesn't seem to have much if any effect ( maybe im doing something wrong) unless you have gotten it working. I know its a thing in dx. Sam |
||||
|
Hi Sam - no, Im not changing any of the vertex colors actually... |
||||
|
It seems like you are using "Custom Cloud Scenenode" or maybe a Spheremesh to create the Aurora effect. |
||||
|
Hi Guest, can you give a single answer of the node type and method of changing the colors & position over time ? |
||||
|
You are using the "Custom Cloud Scenenode" as the node type. And you are using cross fade mechanism between layers of cloud textures to change the color of the aurora over time. |
||||
|
guest_Guru wrote: You are using the "Custom Cloud Scenenode" as the node type. And you are using cross fade mechanism between layers of cloud textures to change the color of the aurora over time. Yep, you got it - well done. I Didnt think anyone would work it out actually. I only use 4 textures and cross fade between them to give the changing color and positions over time. I change out the next texture at its final end (fully faded in or fully faded out) and keep switching between the 2 - seems to work ok for a more generalised fading between textures - not as animated as a full spritesheet but works well enough here. Im using my cloud scene node system also. Send me an email address for payment via Paypal or other method. The code if anyone wants to know is here: *** before start: var aurCycle = false; // start off var aurFade = 0; // start at no fade var aurAdj = 0.01; // speed of change var nextTex = 2; var parentN = ccbGetSceneNodeFromName("AuroraP"); // SKYCLOUD var aurNode = ccbGetCloudLayer(parentN, "BG1.png", "BG2.png", true); ccbSetSceneNodeProperty(aurNode, "CloudHeight", 0.35, 0.07, -0.05); ccbSetSceneNodeProperty(aurNode, "TextureScale", 0.2); ccbSetSceneNodeProperty(aurNode, "EmissiveColor", 70,70,70); *** on press activate button aurCycle = true; *** every 50 ms: // Aurora Merge if (aurCycle) { aurFade += aurAdj; if (aurFade > 1) { aurFade = 1; aurAdj *= -1; nextTex++; if (nextTex > 4) {nextTex = 1;} // 4 textures max used here var Texture = "BG" + nextTex; tex = ccbLoadTexture("data/images/" + Texture + ".png", false); // no mips maps needed ccbSetSceneNodeMaterialProperty(aurNode, 0, "Texture1", tex); } else if (aurFade < 0) { aurFade = 0; aurAdj *= -1; nextTex++; if (nextTex > 4) {nextTex = 1;} var Texture = "BG" + nextTex; tex = ccbLoadTexture("data/images/" + Texture + ".png", false); ccbSetSceneNodeMaterialProperty(aurNode, 0, "Texture2", tex); } ccbSetCrossFade(aurNode, 0, 0, aurFade); } |
||||
|
I may change the API - ccbGetCloudLayer(parentN, "BG1.png", "BG2.png", true) - so that you can load the initial textures from anywhere - not only from: data/images/... as once started you can make use of ccbSetSceneNodeMaterialProperty well enough to change them out... |
||||
|
make sure to put: var tex; - in initialize it also. For me was already initialized elsewhere... |
||||
|
Hi instead of recieving the price money can I give the paypal link of other developer, because paypal doesn't work i our country and I want to support that developer maybe you can send the money to that developer? |
||||
|
sure Guru - as you like - just post an email you like me to send it to.. |
||||
|
|