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.
nw::gfx::res::ResGraphicsFile::Setup
Specify a location in memory before setup as necessary using nw::gfx::res::ResGraphicsFile::ForeachTexture or other such function.
nw::gfx::SceneBuilder
SceneInitializer::Begin → SceneNode::Accept → SceneInitializer::End
SceneTraverser::Begin → SceneNode::Accept → SceneTraverser::End
SceneEnvironmentSetting::ResolveReference → SceneEnvironment::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.
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.
nw::gfx::RenderContext::SetRenderTarget
nw::gfx::RenderContext::SetCameraMatrix
nw::gfx::MeshRenderer::RenderMesh
nw::gfx::RenderContext::ResetState
Render models using the camera matrix set using SetCameraMatrix for the configured render targets.
Reset the status of RenderContext and SceneEnvironment by calling ResetState.
The following is a list of basic features compared with NW4R.
| Feature | NW4C | NW4R | Supplemental 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 |
| Package | Name | Internal Hierarchical Structure | Skinning | Vertex morphing (Shape animation) |
|---|---|---|---|---|
| NW4C | Model | × | × | O (Not implemented.) |
SkeletalModel | ○ | ○ | O (Not implemented.) | |
| NW4R | ScnMdlSimple | ○ | ○ | × |
ScnMdl | ○ | ○ | ○ | |
| ScnMdl1Mat1Shp | × | × | × |
ScnMdl1Mat1Shp has been replaced by Model.ScnMdlSimple and ScnMdl have been replaced by SkeletalModel.CONFIDENTIAL