Creating textures using NWcreate is complicated. The code below is extracted from the attached project.
It is a very small sample that should create a basic texture map. This is built with Navisworks 2012. To work with the sample,
1) copy the project to <Navisworks Manage 2012>\api\nwcreate\examples, thus the project setting does not need to modify
2) switch the configuration to Win32 or X64 per your machine OS
3) The EXE will be exported to
Win32: <Navisworks Manage 2012>\api\nwcreate\release
X64: <Navisworks Manage 2012>\api\nwcreate\release\X64
4) on X64, make a copy of <Navisworks Manage 2012>\api\nwcreate\release\nwcreate_data to <Navisworks Manage 2012>\api\nwcreate\release\X64. These are required files, but installation missed to make a copy in release\X64.
5) build and run, you should get a file called "test.nwc" in the same directory as the source code,
6) load the nwc ro Navisworks you should see a material in Presenter.
7) switch into full render by ViewPoint tab >> Render Style to see the geometry with the texture.
The sample code creates a basic Presenter material with a texture map that is repeated ("wrapped image"), and it just specifies a basic "phong" reflectance shader. You should be able to attach the Presenter material to a node using LiNwcNodeAddAttribute
- A Presenter material has 5 classes of shader. You normally have to specify at least the "color" shader, the other shaders are optional.
- Best way to understand is probably to switch your Presenter into "Advanced" mode (Global Options -> Tools -> Presenter -> Profile -> Advanced). Then load a file that contains some Presenter materials (I think the Ice Stadium example file does). Then double-click on a material, and you should see a tab for each type of shader (e.g. color, reflectance...).
- Each shader type (or class) can have one of several shaders, and each shader has different arguments. The complete list is described in the "shaders.chm" file that ships with the product (you should be able to find it, think it's in the COM/documentation) directory. Should be pretty straightforward to understand.
#define LI_NWC_NO_PROGRESS_CALLBACKS NULL
#define LI_NWC_NO_USER_DATA NULL
LcNwcPresenterMaterial *material =
// Setup the colour shader.
// Let's just got for a basic phong reflectance shader.
LtWideString wfilename = L"test.nwc";
//create scene and geometry
scene = LiNwcSceneCreate();
geom = LiNwcGeometryCreate();
//open geometry stream, draw a triangle, close stream
stream = LiNwcGeometryOpenStream(geom);
LiNwcGeometryStreamBegin (stream, 0);
LiNwcGeometryStreamTriangleVertex(stream, 1, 0, 0);
LiNwcGeometryStreamTriangleVertex(stream, 2, 0, 10);
LiNwcGeometryStreamTriangleVertex(stream, 3, 10, 10);
LcNwcPresenterMaterial *mat =
LiNwcGeometryCloseStream( geom, stream);
//add the geometry to the scene and cleanup geom
LiNwcSceneAddNode (scene, geom);
//write out the NWC file
wfilename, 0, 0);
int main(int argc, char* argv)
// Initialise low-level API first.
// Then initialise the rest of the API.