ambiera home ambiera home

Ambiera Forum

Discussions, Help and Support.

Create a new account, Search, or Login:
Name:  Password:
Ambiera Forum > CopperCube > Programming and Scripting
Live transparancy adjustments for mesh textures
Author Text

douwedabbe
Registered User
Quote
2019-06-10 10:52:33

I want to know if it is possible to modify transparancy of an png image attached to a 2D mesh through js scripting/actions etc.

2D_Overlay meshes do have the "Alpha" property but I can't use them, as my image and 2d Mesh are to large (approx 10x device.width). Feature needed for the android platform.

thanks


guest
Guest
Quote
2019-06-13 01:20:45

Scripting Window:
=================
// try some transparancy settings
var s = ccbGetSceneNodeFromName("MapBox_planeMesh");
var thing = ccbGetSceneNodeProperty(s, "Type");
print("The thing's Type is " + thing);

var t = ccbGetSceneNodeMaterialProperty(s, 0, "Texture1");
print("The plane texture is " + t);

var diff = ccbGetSceneNodeMaterialProperty(s, 0, "Diffuse");
print("The plane init difuseness is at " + diff);

var vect = new vector3d(255, 0, 0);
ccbSetSceneNodeMaterialProperty(s, 0, "Diffuse", vect);
var diff = ccbGetSceneNodeMaterialProperty(s, 0, "Diffuse");
print("The plane new difuseness is at " + diff);

ccbSetSceneNodeMaterialProperty(s, 0, "trans_add", 125);
ccbSetSceneNodeMaterialProperty(s, 0, "trans_alphach", 125);
// var trans = ccbGetSceneNodeMaterialProperty(s, 0, "trans_add");
print("The plane transparancy is at " + trans);



Message Log:
============
The thing's Type is mesh
The plane texture is c:\users\douwe dabbe\downloads\0-app-stuff\scr-screenshot\mapbox-layer-deventer.png
The plane init difuseness is at (0, 0.007843, 0.333333)
The plane new difuseness is at (0, 0.007843, 0.333333)
The plane transparancy is at false


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inte?national" (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.