25 info(
"Hierarchical scenegraph with multiple subgroups in the figure. "
26 "The goal is design a figure with hierarchical transforms containing only rotations and translations. "
27 "You can see the hierarchy better in the Scenegraph window. In there the nodes are white and the meshes yellow. "
28 "You can view the axis aligned bounding boxes with key B and the nodes origin and axis with key X.");
46 floorRect->
rotate(90, -1, 0, 0);
59 light1->
powers(0.2f, 0.9f, 0.9f);
100 feet->
rotate(-90.0f, 1.0f, 0.0f, 0.0f);
119 leglow->
rotate(0, 1.0f, 0.0f, 0.0f);
149 cyl =
new SLNode(
new SLCylinder(am, 0.15f, 1.0f, 1, res,
true,
false,
"low arm mesh", mat),
"low arm (T7)");
153 armlow->
rotate(45, -1.0f, 0.0f, 0.0f);
158 cyl =
new SLNode(
new SLCylinder(am, 0.2f, 1.0f, 1, res,
false,
false,
"upper arm mesh", mat),
"upper arm (T5)");
166 armLeft->
rotate(10, -1, 0, 0);
168 SLNode* armRight =
new SLNode(
"right arm group (T4,R3)");
170 armRight->
rotate(-60, -1, 0, 0);
181 SLNode* neck =
new SLNode(
new SLCylinder(am, 0.25f, 0.3f, 1, res,
false,
false,
"neck mesh", mat),
"neck (T2)");
186 figure->
addChild(
new SLNode(
new SLBox(am, -0.8f, -0.4f, 0.0f, 0.8f, 0.4f, 2.0f,
"chest mesh", mat),
"chest"));
193 figure->
rotate(90, 1, 0, 0);
199 legLeft->
rotate(30, -1, 0, 0);
210 armLeft->
rotate(-45, -1, 0, 0);
214 armRight->
rotate(45, -1, 0, 0);
The AppCommon class holds the top-level instances of the app-demo.
@ EC_inOutQuint
quintic easing in and then out
@ AL_pingPongLoop
loop forward and backwards
SLVec2< SLfloat > SLVec2f
SLVec3< SLfloat > SLVec3f
SLVec4< SLfloat > SLCol4f
static SLDeviceRotation devRot
Mobile device rotation from IMU.
static SLDeviceLocation devLoc
Mobile device location from GPS.
SLAnimation * createNodeAnimation(SLfloat duration)
SLAnimation is the base container for all animation data.
SLNodeAnimTrack * createNodeAnimTrackForRotation(SLNode *target, SLfloat angleDeg1, const SLVec3f &axis)
Toplevel holder of the assets meshes, materials, textures and shaders.
void colors(const SLCol4f &uniformColor)
Sets a uniform background color.
Active or visible camera node class.
void devRotLoc(SLDeviceRotation *devRot, SLDeviceLocation *devLoc)
void focalDist(const SLfloat f)
SLBackground & background()
SLCylinder is creates sphere mesh based on its SLRevolver methods.
void attenuation(const SLfloat kConstant, const SLfloat kLinear, const SLfloat kQuadratic)
void powers(SLfloat ambiPow, SLfloat diffPow, SLfloat specPow, const SLCol4f &ambiDiffSpecCol=SLCol4f::WHITE)
Sets the ambient, diffuse and specular powers all with the same color.
SLLightSpot class for a spot light source.
Defines a standard CG material with textures and a shader program.
An SLMesh object is a triangulated mesh, drawn with one draw call.
SLNode represents a node in a hierarchical scene graph.
void addChild(SLNode *child)
void translation(const SLVec3f &pos, SLTransformSpace relativeTo=TS_parent)
void rotate(const SLQuat4f &rot, SLTransformSpace relativeTo=TS_object)
virtual SLNode * copyRec()
T * findChild(const SLstring &name="", SLbool findRecursive=true)
virtual void addMesh(SLMesh *mesh)
void lookAt(SLfloat targetX, SLfloat targetY, SLfloat targetZ, SLfloat upX=0, SLfloat upY=1, SLfloat upZ=0, SLTransformSpace relativeTo=TS_world)
void translate(const SLVec3f &vec, SLTransformSpace relativeTo=TS_object)
SLRectangle creates a rectangular mesh with a certain resolution.
The SLScene class represents the top level instance holding the scene structure.
SLAnimManager & animManager()
SceneView class represents a dynamic real time 3D view onto the scene.
void camera(SLCamera *camera)
SLSphere creates a sphere mesh based on SLSpheric w. 180 deg polar angle.