Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Changing Cube color accessing it vertices

sagh0900
Registered User
Quote
2012-11-23 23:25:43

Hi, I want to apply the color to cube in the scene by accessing its vertices. How could I do that?


niko
Moderator
Quote
2012-11-24 08:05:30

I haven't tried this out, but something like this might work:

var mesh = yourNode.getMesh();
var buffers = mesh.GetMeshBuffers();
for (var i=0; i<buffers.length; ++i)
{
var vertices = buffers[i].Vertices;
for (var v=0; v<vertices.length; ++v)
{
var vtx = vertices[v];
vtx.Color = CL3D.createColor(255, 255, 0, 0);
}
}



This makes all vertices red.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internat?onal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact