Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Returning the material type of a custom mesh

bagg
Registered User
Quote
2011-03-02 10:44:30

Hi Niko.
It's been a long time since i posted my last thread.
I hope you are ok.
Can you please point me on how to return the material type of a meshbuffer in a custom meshscenenode?

i can have the texture if i have

var Texture = meshBuffer[0].Mat.Tex1.getURL();

but the
var MatType = meshBuffer[0].Mat.Type returns undefined.

Can ypu help me please?

Thanks


niko
Moderator
Quote
2011-03-03 09:41:42

Hm that looks ok, did you set the material type yourself sometime in the past?


bagg
Registered User
Quote
2011-03-03 10:37:52

Yes i did

Gpbuff.Mat.Type = CL3D.Material.EMT_SOLID;

and it's working ok but it doesn't returning it.

I suspect that i need to set something similar like

MeshNode.prototype.getMesh = function()
{
return this.GpMesh;
}
for the material type but i don't know how????


niko
Moderator
Quote
2011-03-03 13:13:07

Maybe you could post your code of your custom scene node here, difficult to say what could be your problem there.


bagg
Registered User
Quote
2011-03-04 07:42:09

Ok never mind found it i just had to set the var MatType as table (var MatType = []; and then to get it as MatType[i]=buff[i].Mat.Type;)

Now i want to ask you if it's near an update of copperlicht with lights and some decent materials.(By the way have a look at three.js library the guys have done very good job with that.)


niko
Moderator
Quote
2011-03-04 10:21:28

Working on dynamic lights now, but it still could take a while.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "I?ternational" (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