23 info(
"All 3D objects are in the _root3D scene and the center text is in the _root2D scene "
24 "and rendered in orthographic projection in screen space.");
53 light1->
powers(0.2f, 0.8f, 1.0f);
58 SLstring txt =
"This is text in 3D with font07";
61 t07->
translate(-size.
x * 0.5f * scale, 1.0f, 0);
64 txt =
"This is text in 3D with font09";
67 t09->
translate(-size.
x * 0.5f * scale, 0.8f, 0);
70 txt =
"This is text in 3D with font12";
73 t12->
translate(-size.
x * 0.5f * scale, 0.6f, 0);
76 txt =
"This is text in 3D with font20";
79 t20->
translate(-size.
x * 0.5f * scale, -0.8f, 0);
82 txt =
"This is text in 3D with font22";
85 t22->
translate(-size.
x * 0.5f * scale, -1.2f, 0);
89 txt =
"This is text in 2D with font16";
The AppCommon class holds the top-level instances of the app-demo.
Class declaration for an SLScene inherited class.
SLVec4< SLfloat > SLCol4f
static SLDeviceRotation devRot
Mobile device rotation from IMU.
static SLDeviceLocation devLoc
Mobile device location from GPS.
void assemble(SLAssetManager *am, SLSceneView *sv) override
After parallel loading of the assets the scene gets assembled in here.
void registerAssetsToLoad(SLAssetLoader &al) override
All scene specific assets have to be registered for async loading in here.
AppDemoScene2Dand3DText()
Toplevel holder of the assets meshes, materials, textures and shaders.
static SLTexFont * font20
20 pixel high fixed size font
static SLTexFont * font09
9 pixel high fixed size font
static SLTexFont * font22
22 pixel high fixed size font
static SLTexFont * font07
7 pixel high fixed size font
static SLTexFont * font12
12 pixel high fixed size font
static SLTexFont * font16
16 pixel high fixed size font
void colors(const SLCol4f &uniformColor)
Sets a uniform background color.
Active or visible camera node class.
void clipFar(const SLfloat cFar)
void clipNear(const SLfloat cNear)
void devRotLoc(SLDeviceRotation *devRot, SLDeviceLocation *devLoc)
void focalDist(const SLfloat f)
SLBackground & background()
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.
SLNode represents a node in a hierarchical scene graph.
void addChild(SLNode *child)
void translation(const SLVec3f &pos, SLTransformSpace relativeTo=TS_parent)
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)
The SLScene class represents the top level instance holding the scene structure.
SceneView class represents a dynamic real time 3D view onto the scene.
void camera(SLCamera *camera)
void doWaitOnIdle(SLbool doWI)
SLSphere creates a sphere mesh based on SLSpheric w. 180 deg polar angle.
SLVec2f calcTextSize(const SLstring &text, SLfloat maxWidth=0.0f, SLfloat lineHeightFactor=1.5f)
SLText creates a mesh using a textured font from SLTexFont.