These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

script used in gallery doesn't correlate to API

relswick
relswick's picture
Registered: Jan 4 2009
Posts: 4

Does anyone know how this exmaple in the Adobe 3D Gallery is using the included javascript:

http://acrobatusers.com/auc/content/gallery/3d_gallery/gallery_assets/concept_car/Concept_Car_Customization.pdf

I am mainly looking to change the diffuse color, but the API for version 8.1 states the diffuse color is read only.

In the script, there is a method called ChangeColor and it does the following:

   context3D.setMaterialColor(context3D.PaintMaterialArray, ColorArray);
yet, the context doesn't recognize this as a method in another PDF I am working with. What gives?

also,
var PaintMaterialArray = new Array("paint", "paint1");
is defined in an Initialization document level function.

mvid
mvid's picture
Registered: Jul 29 2008
Posts: 16
But setMaterialColor is defined there as

function setMaterialColor(materialArray,colorArray)
{
for (index in materialArray)
scene.materials.getByName(materialArray[index]).diffuseColor.set(new Color(colorArray[0]/255,colorArray[1]/255,colorArray[2]/255));
}

Thank you for finding the hidden functionality of colors being writable.
(What else Adobe keeps for its private use?).
Manuel Lastra
Manuel Lastra's picture
Registered: Mar 29 2009
Posts: 6
Have a look to this


http://www.3dcadforums.com/graphics-communities-86/acrobat-3d-forum-42/how-change-diffuse-color-js-401.php