# G3D Sample Demo

## Location

`$TwlSystem/build/demos/g3d/`

## Compilation

Move to the `$TwlSystem/build/demos/g3d` directory and run:

> `% make`

Compiling begins, and the SRL executable file and the NEF or TEF files with the binary information are generated in:

> `$TwlSystem/build/demos/g3d/samples/sample_name/bin/(platform)/(target)/`

For example:

> `$TwlSystem/build/demos/g3d/samples/simple/bin/ARM9-TS.HYB/Release/`

The executable file of the release version for the NITRO/TWL hybrid of the `simple` demo is generated in the path described above.

## Execution

Move to the `$TwlSystem/build/demos/g3d/samples/(sample_name)/bin/(platform)/(target)/` directory. Depending on the type of the built ROM, one of the following methods is used for execution.

### For NITRO ROMs

When using the Ensata emulator:

- Execute the NEF and SRL files with `ensata`.

When using IS-NITRO-DEBUGGER:

- Load and execute an NLF file with IS-NITRO-DEBUGGER.
- Execute an SRL file with IS-NITRO-DEBUGGER.
- Execute an SRL file with IS-NITRO-DEBUGGER using the `loadrun.exe` tool from a command line.

When using IS-TWL-DEBUGGER:

- Load and execute an NLF file with IS-TWL-DEBUGGER.
- Execute an SRL file with IS-TWL-DEBUGGER.
- Execute an SRL file with IS-TWL-DEBUGGER using the `loadrun.TWL.exe` tool from a command line.

### For TWL/NITRO Hybrid ROMs

When using IS-NITRO-DEBUGGER:

- Execute an SRL file with IS-NITRO-DEBUGGER.
- Execute an SRL file with IS-NITRO-DEBUGGER using the `loadrun.exe` tool from a command line.

When using IS-TWL-DEBUGGER:

- Load and execute a TLF file with IS-TWL-DEBUGGER.
- Execute an SRL file with IS-TWL-DEBUGGER.
- Execute an SRL file with IS-TWL-DEBUGGER using the `loadrun.TWL.exe` tool from a command line.

### For TWL Limited ROMs

When using IS-TWL-DEBUGGER:

- Load and execute a TLF file with IS-TWL-DEBUGGER.
- Execute an SRL file with IS-TWL-DEBUGGER.
- Execute an SRL file with IS-TWL-DEBUGGER using the `loadrun.TWL.exe` tool from a command line.

## Description

#### Sample

`simple` | A simple sample that displays textured model rendering.
`1mat1shp` | A sample that displays a very simple model quickly.
`callback1` | A sample(1) that allows customization to rendering processes using callback function registration. Displays a model by changing the calculation results for partial visibility, material, and the like.
`callback2` | A sample(2) that allows customization to rendering processes using callback function registration. Takes nodes specified in a model, attaches them to another model, and displays.
`callback3` | A sample(3) that allows customization to rendering processes using callback function registration. Performs calculations that are unrelated to rendering while transmitting the display list.
`callback4` | A sample(4) that allows customization to rendering processes using callback function registration. Processes and resets the current matrix after joint animation application.
`callback5` | A sample(5) that allows customization to rendering processes using callback function registration. Makes multiple settings for the callback function.
`CameraMtx` | A sample that displays billboards. Also changes the projection matrix settings and compares drawing efficiency.
`CustomizeSbcOp` | A sample that changes the SBC command processing functions to the functions customized by the user.
`DisposeTex` | A sample that performs operations with no problems even if the texture regions have been reset to zero after the model textures have been transferred to the VRAM.
`Envelope` | A sample that displays a model that has a weighted envelope.
`GeComBuffering` | A sample that uses the geometry command buffering feature.
`JointAnm` | A sample that plays model joint animation.
`PartialAnm1` | A sample that plays a portion of the model joint animation.
`PartialAnm2` | A sample that combines and plays portions of the model joint animation.
`SlowMotion` | A sample that plays the model joint animation in slow motion.
`SharedMotion` | A sample that plays the same joint animation with models of different shapes.
`ManualSetup` | A sample that sets up the model resource without using the `NNS_G3dResDefaultSetup` function.
`MatColAnm` | A sample that plays the material color animation.
`ModifyNsbmd` | A sample that changes the model's material color and light settings.
`MotionLOD` | A sample that reduces CPU processing by decreasing the frame rate of the character animation that is placed in the distance.
`MultiModel` | A sample that merges several models using a converter and draws the result.
`RecordJoint` | A sample that precalculates the result of the joint.
`RecordMaterial` | A sample that precalculates the result of the material.
`RecordMtx` | A sample that operates in the same way as the `callback2` sample but without using callbacks.
`SeparateTex` | A sample that splits and outputs model and texture binary with a converter and displays them with appropriate links.
`ShadowVolume` | A sample that renders the shadow volume using G3D.
`TexPatternAnm` | A sample that plays the texture pattern animation.
`TexSRTAnm` | A sample that plays the texture SRT animation.
`UnbindTex` | A sample that partially removes textures in the model and reapplies them.
`VisibilityAnm` | A sample that plays visibility animation.
`ScreenUtil` | A sample that uses the coordinate conversion utility API of G3D.
`Translucent` | A sample that draws an object that has overlapping translucent polygons.
`EnvMap` | A sample that displays environment-mapped objects.
`ProjMap` | A sample that displays projection-mapped objects.

## Operating Environment

Normal operation for all of the samples using IS-TWL-DEBUGGER, IS-NITRO-EMULATOR, and Ensata has been confirmed.

## See Also

G3D Function List

## Revision History

2008/06/20 Updated compiling method and execution method for TWL.
2008/02/26 Added to the descriptions of callback samples.
2005/01/24 Deleted the description of IS-NITRO-EMULATOR in Execution, deleted the description of TEG in Operating Environment, and changed TS to IS-NITRO-EMULATOR.
2005/01/21 Added two samples: `EnvMap` and `ProjMap`.
2004/11/26 Added `Translucent` sample.
2004/11/10 Added five samples: `PartialAnm1`, `PartialAnm2`, `SlowMotion`, `SharedMotion`, and `ScreenUtil`.
2004/10/12 Added five samples: `callback5`, `Envelope`, `ManualSetup`, `RecordMtx`, and `ShadowVolume`.
2004/09/16 Added two samples: `callback4` and `MotionLOD`.
2004/09/01 Added three samples; `1mat1shp`, `callback3`, and `GeComBuffering`.
2004/08/10 Added some samples.
2004/08/02 Initial version.

CONFIDENTIAL