Change a texture in a PDF3D

Hello!
I have a question.
Is it possible to change the texture of a 3D object (in a PDF3D) without regenerating the PDF3D?
How to do that? With javascript?
Thank you!

Is there any example of how to set a texture of 3DModel through Javascript?
I tried following but I always get "Resource is not defined" error:
// Create a new Resource with the file's URI as the argument
modelResource = new Resource( "pdf://sphere.u3d" );
// use Scene method "addModel" with Resource as an argument,
// returns top level node from loaded 3D file
model = scene.addModel( modelResource );
// Create a new Resource with the file's URI as the argument
imageResource = new Resource( "pdf://grid.jpg" );
// use the Image constructor with the Resource as an argument,
image        = new Image( imageResource );
// set the loaded 3D model's diffuse texture to the image
model.material.diffuseTexture.setImage( image );
// loading of resources can be inlined if they are only used once
bump        = new Image( new Resource( "pdf://knurl.jpg" ) );
// set the loaded 3D model's bump texture to the image
model.material.bumpTexture.setImage( bump );

Similar Messages

  • When I insert a shape, how do I change the color without changing the texture?

    When I insert a shape, how do I change the color without changing the texture?

    Hi,
    you are working with a percentage width of your tables, for example:
    table width="123%
    td width="75%"
    td width="25%"
    So it is simply a arithmetic problem to get the proportional wide (means the ratio of % to cm) of your images, so that they do not break the frame. Certainly you could use (translated from German DW) "properties" and change the sizes there:
    Hans-G.

  • Changing the texture in 3D chart

    How do I change the texture on a 3D chart? I've searched all over the Help, but I can't find it anywhere...

    Don't mention it
    I originally came to the discussions looking to find out how how to apply the wooden effect to my charts in Pages. After finding this thread with the search tool I thought I'd poke around more for the texture files.
    I noticed that the textures used on charts in Keynote were dependent upon the theme and could not be changed. Therefore - I poked around in the Theme's package contents
    Sam

  • Keynote - Changing chart textures in a custom theme

    I know there are a couple different textures for the charts in the regular themes. I have created a custom theme for my company and I would like to be able to change the texture on the charts. But I can't seem to figure out how to choose which texture is used.
    Does anyone know how to do that?

    Darin, this is covered in the Keynote User Guide (p.179 in the KN3 guide). To quote:
    To set default chart attributes:
    1 In the slide organizer, create a new slide based on the master slide you are designing.
    2 Place a chart on the slide canvas.
    3 Select the chart and set its attributes. (For more information, see Chapter 6, “Creating Charts.”)
    4 To define defaults for another chart type, copy the chart and paste it on a new slide, change the chart type, and set the chart attributes. Repeat this step for each chart type.
    5 When all the charts are formatted as you wish, select each of them, one at a time, and make the new properties the default by doing one of the following:
    - To make the chart’s attributes the default for the current master, choose Format > Advanced > Define [chart] for Current Master.
    - To make the chart’s attributes the default for all the masters in the current theme, choose Format > Advanced > Define [chart] for All Masters.
    - To make the chart’s type the default for all master slides in the current theme, choose Format > Advanced > Make [chart] the Default Chart Type.
    6 In the dialog that appears, specify the total number of series for which you are defining attributes.
    7 Delete the charts from the slides.
    PowerMac G5   Mac OS X (10.4.4)  

  • Hello Apple! I see that you have made really good stuff in the new OS X Yosemite version. But you have changed the Texture. Why??? I dont now. Please do a texture-change-program to change the textures. The textures from Mavericks and Yosemite!

    OS X Yosemite is pretty good, but the texture is not good! Please do a texture-change-program. What this is? Its a option in the system settings. What this makes? Its changing the texture. Which texture? From OS X Yosemite and Mavericks. Please change the Mavericks texture! So, that everybody like it! That it looks like the best texture on the world! If you make this, I would be really happy!
    Dear Zuebeyir Said Capar.

    Sorry but you are not speaking to Apple on these forums. This is a user to user forum. To send feedback directly to Apple use this link:
    http://www.apple.com/feedback/

  • Changing multiple texture paths in Adobe Flash CS5

    Hey everyone,
    I'm desperately searching for a way to swap out multiple texture paths of images in my library.
    For instance, say I put a set of 5 textures in Adobe/Bitmaps. Later I decide to move the 5 textures to Adobe/Textures and delete the old directory. What I typically have to do is go into each texture file's properties and re-import the image with the new path in place.
    This is fine if I were only dealing with a handful of textures, but as it is, I have nearly 75 or so textures to re-path! If anyone knows of an out-of-the-box way around this or knows of any Flash extensions that could get around this issue and wouldn't mind sharing it here, I'd greatly appreciate it! I've searched around on google and have, so far, come up completely empty.
    Thanks in advance.

    Well I did use actionscript for creating the actual index and effects, but AS3 was used no further for the index. I created an index which had links Part 1, Part 2 ,3,4,5 and clicking on each of them lead to different frames (using the mouseclick, goto and stop at frame (x) function.) Clicking on part one for example would lead to list of documents in that part. Sorry I can't be of any help, I'm totally new to this

  • Importing a class file to change the Texture colour of a JFrame and JMenu?

    Well, my friend told me its possible, he has it on his Jframe, this is the code he uses;
    package theme;
    import javax.swing.plaf.ColorUIResource;
    import javax.swing.plaf.metal.OceanTheme;
    public class BlackTheme extends OceanTheme
        public BlackTheme()
        public String getName()
            return "Black";
        protected ColorUIResource getPrimary1()
            return primary1;
        protected ColorUIResource getPrimary2()
            return primary2;
        protected ColorUIResource getPrimary3()
            return primary3;
        protected ColorUIResource getSecondary1()
            return secondary1;
        protected ColorUIResource getSecondary2()
            return secondary2;
        protected ColorUIResource getSecondary3()
            return secondary3;
        protected ColorUIResource getBlack()
            return black;
        protected ColorUIResource getWhite()
            return white;
        private final ColorUIResource primary1 = new ColorUIResource(33, 33, 33);
        private final ColorUIResource primary2 = new ColorUIResource(160, 160, 160);
        private final ColorUIResource primary3 = new ColorUIResource(77, 77, 77);
        private final ColorUIResource secondary1 = new ColorUIResource(0, 0, 0);
        private final ColorUIResource secondary2 = new ColorUIResource(51, 51, 51);
        private final ColorUIResource secondary3 = new ColorUIResource(100, 100, 100);
        private final ColorUIResource black = new ColorUIResource(20, 20, 20);
        private final ColorUIResource white = new ColorUIResource(125, 125, 125);
    }So how would i make it use that as the JFrame etc, because i tried like
    import theme.BlackTheme;and
    MetalLookAndFeel.setCurrentTheme(new BlackTheme()); but it dosn't re-colour it, am i doing something wrong? It only re-colours the actuall outside frame, not the main bits or menu bar as it is suppose to.
    Thanks

    Here are pictures of how the bar should look and what mine looks like.
    THIS IS WHAT MINE LOOKS LIKE
    [http://i166.photobucket.com/albums/u116/the_owner2007/menubaretc.jpg]
    This is how it should look correct...
    [http://i166.photobucket.com/albums/u116/the_owner2007/menubaretcblack.jpg]
    Edited by: i_own_pking on Apr 5, 2008 4:07 AM

  • How can I have users change textures in acrobat 3d and Reader question tia sal2

    I'm trying to have users in Acrobat reader change textures of a box which I made in acrobat 3d
    how can I do this?
    Example
    I made three textures for a box and I would like the user to have the ability to change the textures if they choose. How can I do this? Any examples?
    Can I have a user select the textures or the layers from a photoshop file in Acrobat 3d?
    Tia sal2

    Yo ratboy,
    You can do this. In order to map the images, they must be attached as a 3D resource. (There is a free plugin for this; search the forum for "Attach3DResource.api"). Once the images are attached, you can use the 3D Javascript API to map them to the meshes you desire.
    For one doc, I attached 25 images in this manner. I then used the script below to create a bunch of empty meshes, and then apply the images to said meshes.
    Hope this helps!
    //3D javascript ========================================
    //create 25 procedural meshes ======
    var leftEdge = -180;
    var horizontalOffset = leftEdge;
    var verticalOffset = 0;
    var myMesh = new Array();
    var myVector = new Array();
    for ( i=0; i<25; i++ ) { myMesh[i] = scene.createSquareMesh(64, 48, "myMesh" + i); myVector[i] = new Vector3( horizontalOffset, verticalOffset, 0 ); myMesh[i].transform.translateInPlace(myVector[i]); horizontalOffset += 74; if ( horizontalOffset > 180 )
    horizontalOffset = leftEdge;
    verticalOffset += 58;
    //create image array and resource objs ============
    var myImageResources = new Array();
    var myImageFiles = new Array("8d91.jpg",
    "ad2e.jpg",
    "barnpond.jpg",
    "Beach01.jpg",
    "Beach04.jpg",
    "Beach05.jpg",
    "Beach06.jpg",
    "Beach13.jpg",
    "bike trailer.jpg",
    "cobra.jpg",
    "cr80xr200.jpg",
    "craigs_place.jpg",
    "Dandrea.jpg",
    "dirtbike.jpg",
    "e027.jpg",
    "f5b5.jpg",
    "f613.jpg",
    "halfdome.jpg",
    "Iceberg.jpg",
    "island.jpg",
    "kx100_gb.jpg",
    "maui_horanhero.jpg",
    "norcal_ocean.jpg",
    "sierraLake.jpg",
    "Smokey Light.jpg",
    "test.txt");
    //create resource objs
    for ( i=0; i<25; i++ ) { myImageResources[i] = new Resource("pdf://" + myImageFiles[i]); }
    //load images on meshes with handler ============
    var myImageObjs = new Array();
    var myImageMats = new Array();
    myRenderer = new RenderEventHandler();
    myRenderer.onEvent = function(renderEvent)
    for ( i=0; i<25; i++ ) { //create image from resource myImageObjs[i] = new Image(myImageResources[i]); console.println("Image = " + i);
    //add image to model
    myImageMats[i] = myMesh[i].material;
    myImageMats[i].diffuseTexture.setImage(myImageObjs[i]);
    //remove handler
    runtime.removeEventHandler(myRenderer);
    runtime.addEventHandler(myRenderer);
    //cause a recalculation of the scenegraph.
    scene.update();
    console.println("Call scene.update()");
    console.println("Created 25 Square meshes: (64, 48, 'myMeshN')");

  • How to change texture backgrounds in Keynote text box

    I want to know if its possible to change the texture background image of a text box, keeping the background textured but in a different color.
    Sequence:
    Create a text box
    Add text
    In the inspector select "image fill"
    The result is a textured background in a particular color.
    Thinking I might be able to replace the image with another textured image but of a different color I click on "Choose" and a dialog opens that is located at the "pictures" folder in the home folder.
    This makes sense but I wonder if there is a group of textured images somewhere to use as backgrounds?
    And if so where are they located?
    I've searched around and can't find same.
    Perhaps the textured background is unique to the theme.
    Thanks

    Most of the textures are unique to the theme BUT try this:
    1. Put a chart on your slide
    2. Click on the Chart Colors button in the Chart Inspector
    3. See if any of the chart options match what you're looking for and hit Apply All in the chart colors window
    4. Click once on one of the bars in the chart to select it
    5. Choose Copy Style from the format menu
    6. Click on your text box and choose Paste Style from the format menu
    7. Go to the Graphic Inspector and change the fill type from Image Fill to Tinted Image fill
    8. Play around with the color/transparency settings for the Tinted image function by clicking on the box that looks like it's sliced in half diagonally.
    no idea if that's what you're looking for, but you can come up with some fun fills I think.

  • Buttons change texture on object  - got a script now what ?

    I'm newbie on Javascript and I'm trying to figure out this script that was posted by Michael Kreutz on this forum ;
    ---- This is the script that is used on the 3D object -----
    //##### 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);
    ---- This is the script that is used on the button ----
    getAnnots3D(0)[0].context3D.changeDiffuseTexture();
    I'm making a proof of concept to show this (future) client the possibilities of 3D pdf.
    I show a 3D object and besides the 3D object are several buttons that change the texture of the 3D object.
    This 3D object has 2 materials ; one is just diffuse color and the other one has a UVmap on the diffuse map.
    So when one clicks on a button the script should load up the correct UVdiffusemap-image.
    I use this plugin to attach the resource images for the UVmap
    http://www.graysonlang.com/Attach3DResource.api
    Now for the question part :)
    ** When I apply the "getbyindex" version and click a button it replaces the diffusecolor part of the object with the image, instead of the UVmap part - how can I tell javascript to look for my UVmap .. in other words where can I see what the index of this material is -> I've tried changing the numbers in both scripts but that didn't do it !
    The "getbyname" didn't do anything -> where can I see the name of the UVmap part ?
    ** How can I apply the different images to the different buttons ? Or should I do this in the .js-file that is attached to the 3D object ?
    ** Is there a way to make the change of texture realtime - without first having to click on the 3D-window ? That is what happens now when the texture of the diffusecolor part changes !
    Any hint is welcome -
    K.

    I'm newbie on Javascript and I'm trying to figure out this script that was posted by Michael Kreutz on this forum ;
    ---- This is the script that is used on the 3D object -----
    //##### 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);
    ---- This is the script that is used on the button ----
    getAnnots3D(0)[0].context3D.changeDiffuseTexture();
    I'm making a proof of concept to show this (future) client the possibilities of 3D pdf.
    I show a 3D object and besides the 3D object are several buttons that change the texture of the 3D object.
    This 3D object has 2 materials ; one is just diffuse color and the other one has a UVmap on the diffuse map.
    So when one clicks on a button the script should load up the correct UVdiffusemap-image.
    I use this plugin to attach the resource images for the UVmap
    http://www.graysonlang.com/Attach3DResource.api
    Now for the question part :)
    ** When I apply the "getbyindex" version and click a button it replaces the diffusecolor part of the object with the image, instead of the UVmap part - how can I tell javascript to look for my UVmap .. in other words where can I see what the index of this material is -> I've tried changing the numbers in both scripts but that didn't do it !
    The "getbyname" didn't do anything -> where can I see the name of the UVmap part ?
    ** How can I apply the different images to the different buttons ? Or should I do this in the .js-file that is attached to the 3D object ?
    ** Is there a way to make the change of texture realtime - without first having to click on the 3D-window ? That is what happens now when the texture of the diffusecolor part changes !
    Any hint is welcome -
    K.

  • Problem in loading  multiple textures

    hi guys
    i need some help form you in loading *.obj files into my scene. when i load a building into my scene only the white building is loading without any textures. when i tried to load a texture for eg: green...the whole building is in green color. i have some *.mtl files in the same folder but i dont know how to use them.
    here is code :
    ObjectFile file1 = new ObjectFile (ObjectFile.RESIZE);
              Scene scene1 = null;
              Scene scene2 = null;
              scene2 = file1.load("model/street lamps/Lamp_Post_Ornate.OBJ");
              tg_lamp.addChild(scene2.getSceneGroup());
              Appearance appear_lamp=new Appearance();
              TextureLoader loader_lamp = new TextureLoader("texture/building.png", this);
              appear_lamp.setTexture(loader_lamp.getTexture());
              BranchGroup branchGroup1 = scene2.getSceneGroup();
                 shape = (Shape3D) branchGroup1.getChild(0);
                  shape.setAppearance(appear_lamp);
              obj_bg.addChild(tg_lamp);

    hi venkat,
    any way there is some problem with the models download from the net, now i have milkshape3d. i changed some textures and lights. and i export them to obj and mtl file.
    i am developing a car game using javaRmi and java3d. almost my game is completed .(without graphical collisionw). i hva to submit on 21st to the collage.(its my final sem project).
    when i load buildings ,,i got __heap memory issues__
    so i want to add some gif files... will u please tell me where can i get them. and how to solve these heap memory problems
    regards
    satish

  • Can we have two textures for the same project ?

    Hello all
    I use Captivate4. In my project, the background transparency for Playbar controls is 100%. So the texture would be seen as the background for the PlayBar. I have a requirement of hiding PlayBack Controls in few slides. Then I would like to change my texture to some other image. in brief, I would like to show one texture when the PlayBar is visible & another texture when the PlayBar is invisible.
    Is that possible?
    Thanks & regards,
    Kartik.

    OK.  This would be a little easier to do in Captivate 5 which has Master Slides and Playbar Overlay. But since you have Captivate 4 you will need to make do with adding graphics to the background of the actual slide, and just turning off the Playbar.
    From the graphics you added to your last post, it looks like you already know what you want the background to look like. You want a different background for Slide A and Slide B.  One way to do this is to add the graphic to each slide, then right-click and select Merge with Background.  But you can also just put the image on the lowest layer on the timeline of each slide and the effect would be similar.
    Regarding the Playbar...Since you are on Captivate 4, you do not have the option to set Playbar to Overlay.  I've just looked in Captivate 4 but the option is missing.  Here is what the Skin Editor looks like in Captivate 4 and 5.  Notice the Playbar Overlay setting is missing in Cp4.  There may be another way to do this but I don't know.
    This playbar overlay option would have allowed you to set the position of the playbar as sitting over the bottom 30 pixels or so of the stage area.  Since you can't do this, you may need to be satisfied with seeing the area occupied by the playbar go blank when it is hidden.
    To hide your playbar on Slide B, you will need to add an Advanced Action on Slide Enter that turns off the playbar by assigning the variable cpCmndShowPlaybar to 0.  Here is what that looks like in the Slide Properties dialog for your Slide B.

  • Adding texture to a drawing in photoshop

    I have a drawing that I did on Illustrator, that I want to change the texture on the drawing (in photoshop) to make it look like webbing (adding a weave pattern) I was told that I need to do this through the paintbrush, but I need a little more explanation.

    As our Bruce has just told you, there are so many ways to add texture.  Strangely, none of the obvious methods would use the paint brush.  Also, as suggested by our Bruce, it depends entirely on what you want to do, and a scale of any patten involved.
    The denim patten in this was done using the Half Tone filter, for instance.
    There are weave pattens available from Scripted Fill if you have CC, or a great tool to experiment with overlaying textures, is to install the free Flypaper Textures extension by Russell Brown.
    end of the line

  • Diffuse color changing with js

    Hi all
    is it possible to change the diffuse color of a material through a js command? And swaping between different image maps?
    Let say we want to change the color of a chair with a mouse click on a button... Could please someone post a sample piece of code?
    Thanks for helping
    Alberto

    Hi Alberto,
    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
    I hope i could help you
    Michael

  • Change the colors of the 3d world in Lingo

    Is there a way to trigger in lingo a color change of your 3d world? For example, in the game I'm creating, you are able to eat poisonous mushrooms. I was wondering if I could trigger something like a photo negative effect of what the player sees, or possibly a motion bur? Any ideas will help.

    Well you could script a change in the shaders your w3d are using, playing with ambient etc, or you put an almost transparent object in front of the camera (maybe animate some suitably trippy texture on it).
    Or you could go the cpu-hog rout and grab the rendered image and run it through an image filter, to do this I think you still need to turn of the 3d sprites DTS and use software rendering for director to be able to grab images from the sprites image property, then put it on a bitmap sprite on top of the w3d (or move the w3d offstage during this).
    Another possible route is to temporary add the toon modifier to your models, you can get some funky effects out of that, come to think of it you can get some sort of negative effect by changing the textures to a negative version.

Maybe you are looking for