ambiera home ambiera home

Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name:  Password:
Ambiera Forum > CopperLicht
Changing Cube color accessing it vertices
Author Text

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: "Internationa?" (you are not logged in)


Text:

 

  

Forum 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


   





Software: Ambiera Light Forum. © 2008-2019 Nikolaus Gebhardt, Ambiera e.U.