1. Home
  2. /
  3. Urho3d
  4. /
  5. Rotate Object Example

Rotate Object Example - Urho3d Typing CST Test

Loading…

Rotate Object Example — Urho3d Code

Rotates an object around the Y-axis every frame.

#include <Urho3D/Engine/Application.h>
#include <Urho3D/Scene/Scene.h>
#include <Urho3D/Graphics/StaticModel.h>
#include <Urho3D/Graphics/Model.h>

using namespace Urho3D;

class RotateApp : public Application {
public:
	RotateApp(Context* context) : Application(context) {}

	void Setup() override {}
	void Start() override {
		scene_ = new Scene(context_);
		Node* node = scene_->CreateChild("RotatingCube");
		node->CreateComponent<StaticModel>()->SetModel(GetSubsystem<ResourceCache>()->GetModel("Models/Box.mdl"));
		cubeNode = node;
	}

	void Update(float timeStep) override {
		cubeNode->Yaw(50*timeStep);
	}

private:
	SharedPtr<Scene> scene_;
	Node* cubeNode;
};

URHO3D_DEFINE_APPLICATION_MAIN(RotateApp)

Urho3d Language Guide

Urho3D is an open-source, cross-platform 2D and 3D game engine written in C++ with optional AngelScript and Lua scripting. It provides a lightweight, flexible environment for building games and real-time simulations.

Primary Use Cases

  • ▸2D and 3D PC games
  • ▸Mobile games (Android/iOS)
  • ▸Educational simulations
  • ▸Real-time visualizations
  • ▸Interactive prototypes

Notable Features

  • ▸C++ core with scripting via AngelScript/Lua
  • ▸Cross-platform (Windows, macOS, Linux, iOS, Android)
  • ▸Scene graph and node-based architecture
  • ▸Integrated physics (Bullet Physics) and networking
  • ▸Flexible rendering pipeline (shaders, lights, shadows)

Origin & Creator

Urho3D was created in 2007 by the Finnish developer Jukka Jylänki, later developed and maintained by a community of contributors.

Industrial Note

Urho3D is valued by developers seeking a lightweight, open-source engine with full access to C++ code, cross-platform deployment, and integrated physics and rendering systems.

More Urho3d Typing Exercises

Urho3D Simple Counter ExampleUrho3D Move Cube ExampleUrho3D Keyboard Input ExampleUrho3D UI Button ExampleUrho3D Light ExampleUrho3D Camera Follow ExampleUrho3D Particle ExampleUrho3D Physics Cube ExampleUrho3D Animated Model Example

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher