Basic Features

Model Display

The following is a simple procedure for displaying a model.

Information regarding graphics library initialization is left out.
See the InitializeGraphics demo.

For details, see SimpleDemo.

  1. Set up a stream resource.
    nw::gfx::res::ResGraphicsFile::Setup

    Specify a location in memory before setup as necessary using nw::gfx::res::ResGraphicsFile::ForeachTexture or other such function.

  2. Create an instance of the model and initialize.
              nw::gfx::SceneBuilder
    SceneInitializer::BeginSceneNode::AcceptSceneInitializer::End
    SceneTraverser::BeginSceneNode::AcceptSceneTraverser::End
    SceneEnvironmentSetting::ResolveReferenceSceneEnvironment::ApplyFrom

    Create instances of camera and lights as necessary.
    Call nw::gfx::SceneHelper::ResolveReference to apply parent-child relationships of resources to instances.
    Only call SceneInitializer or SceneTraverser when there is a change in the scene tree.
    Select Apply to the SceneEnvironment under SceneEnvironmentSetting when switching scenes.

  3. Update models.

    For the flow of updating and rendering models, see Update Sequence.

              nw::gfx::SceneUpdater::UpdateAll
    nw::gfx::RenderContext::SetActiveCamera
    nw::gfx::SceneUpdater::SubmitView
    Sorting of nw::gfx::RenderQueue

    Set camera, lights and fog for the scene environment as necessary.

  4. Render models.
              nw::gfx::RenderContext::SetRenderTarget
    nw::gfx::RenderContext::SetCameraMatrix
    nw::gfx::MeshRenderer::RenderMesh
    nw::gfx::RenderContext::ResetState
  5. Render models using the camera matrix set using SetCameraMatrix for the configured render targets.
    Reset the status of RenderContext and SceneEnvironment by calling ResetState.

List of Basic Functions

The following is a list of basic features compared with NW4R.

FeatureNW4CNW4RSupplemental Information
Update scene SceneTraverser+SceneUpdater, etc. ScnRoot
Base class for scene elements SceneObject G3dObj/ResCommon Base class representing objects in a scene.
Node making up the scene hierarchical structure. SceneNode ScnGroup SceneNode doesn't contain any transform information.
Node including transform information TransformNode ScnGroup/ScnLeaf
Node for rendering models Model ScnMdl/ScnMdl1Mat1Shp
Model including hierarchical structure SkeletalModel ScnMdl/ScnMdlSimple
Node in a model Bone ResNode Rerpresents a node of the hierarchical structure built into the model.
Camera Camera Camera Cameras in NW4C are a type of TransformNode.
Lights Light LightObj Lights in NW4C are a type of TransformNode.
Light Sets LightSet LightSet Manages combinations of lights to be applied to a model or other object.
Fog Fog Fog Fog in NW4C is a type of TransformNode.
Combining shapes and materials Mesh ResByteCode Represents a set of polygons to be rendered using materials. ResByteCode is a generic class.
Shape (polygonal shape) Shape ResShp
Material (polygon appearance) Material ResMat

Comparison of Model Classes

PackageNameInternal Hierarchical StructureSkinningVertex morphing
(Shape animation)
NW4CModel××O (Not implemented.)
SkeletalModelO (Not implemented.)
NW4RScnMdlSimple×
ScnMdl
ScnMdl1Mat1Shp×××

CONFIDENTIAL