This is the answer on my question I wrote in a thread in acrobat 3d section yesterday...
I found it in a new thread about this on adobe´s forum..
I thought this would be nice to spread to everyone else on this forum!
Here it is:
_____________________________________________
It is possible to change the diffuse color and the diffuse texture of a material. To change the texture you have to add an imageresource to your PDF-file first. Acrobat Professional and Acrobat 3D dont support adding resources. To add a resource you need a plugin. You can download such a plugin here: http://www.graysonlang.com/Attach3DResource.api
Use the following code to change the diffuse color or the diffuse texture of your meshes:
//##### changeDiffuseColor #####
function changeDiffuseColor() {
//##### if you want to call the mesh by index #####
objectMaterial = scene.meshes.getByIndex(0).material;
//##### if you want to call the mesh by name instead of index #####
//objectMaterial = scene.meshes.getByName("theMeshsName").material;
//objectMaterial.diffuseColor.setColor(c1);
objectMaterial.diffuseColor.set3(0.9,0.99,0.1);
}
//##### changeDiffuseTexture #####
function changeDiffuseTexture() {
textureRes = new Resource("pdf://yourTexture.jpg");
textureImg = new Image(textureRes);
//#### if you want to call the mesh by index #####
objectMaterial = scene.meshes.getByIndex(0).material;
//##### if you want to call the mesh by name instead of index #####
//objectMaterial = scene.meshes.getByName("theMeshsName").material;
objectMaterial.diffuseTexture.setImage(textureImg);
}
You can download a working example at my website:
http://www.web-3d.info/material.zip:D
________________________________________
The problem is that i´m not very good at Java System
anyonyone knows some good video tutorials for this application?
/habbe
I found it in a new thread about this on adobe´s forum..
I thought this would be nice to spread to everyone else on this forum!
Here it is:
_____________________________________________
It is possible to change the diffuse color and the diffuse texture of a material. To change the texture you have to add an imageresource to your PDF-file first. Acrobat Professional and Acrobat 3D dont support adding resources. To add a resource you need a plugin. You can download such a plugin here: http://www.graysonlang.com/Attach3DResource.api
Use the following code to change the diffuse color or the diffuse texture of your meshes:
//##### changeDiffuseColor #####
function changeDiffuseColor() {
//##### if you want to call the mesh by index #####
objectMaterial = scene.meshes.getByIndex(0).material;
//##### if you want to call the mesh by name instead of index #####
//objectMaterial = scene.meshes.getByName("theMeshsName").material;
//objectMaterial.diffuseColor.setColor(c1);
objectMaterial.diffuseColor.set3(0.9,0.99,0.1);
}
//##### changeDiffuseTexture #####
function changeDiffuseTexture() {
textureRes = new Resource("pdf://yourTexture.jpg");
textureImg = new Image(textureRes);
//#### if you want to call the mesh by index #####
objectMaterial = scene.meshes.getByIndex(0).material;
//##### if you want to call the mesh by name instead of index #####
//objectMaterial = scene.meshes.getByName("theMeshsName").material;
objectMaterial.diffuseTexture.setImage(textureImg);
}
You can download a working example at my website:
http://www.web-3d.info/material.zip:D
________________________________________
The problem is that i´m not very good at Java System
anyonyone knows some good video tutorials for this application?
/habbe