A3DPDF3DArtworkAddResourceFromFile
-
A3DStatus
A3DPDF3DArtworkAddResourceFromFile(A3DPDF3DArtwork *p3DArtwork, const A3DUTF8Char *pcFullFileName, const A3DUTF8Char *pcResourceName) A3DStatusA3DPDF3DArtworkAddResourceFromFile(A3DPDF3DArtwork* p3DArtwork, constA3DUTF8Char* pcFullFileName, constA3DUTF8Char* pcResourceName)Adds a resource to the 3D Artwork, to be consumed by 3D javascript.
varaxesResource=newResource("pdf://TS3D_Axes.u3d"); scene.addModel(axesResource); g_axes=scene.nodes.getByName("Axes");
The function has to be called after the 3D annot has been created with
A3DPDF3DAnnotCreate(). The resource added in the 3D annotation is to be consumed by javascript stored on 3D context. For example, the following code inserts the geometry in the u3d file into the scene. A new node is created in the model tree that can be moved to an apropriate position.Parameters
p3DArtwork: The 3D Artwork object to work with
pcFullFileName: The file name of the resource file. The file format is deducted from file extension. Only 3D formats, U3D and PRC are supported.
pcResourceName: The name of the resource. This name is used in javascript to access to the resource.
Returns
A3D_SUCCESS in case of success or an error code