Basis

2025/12/27

Type
Learning Resource
Format
Glossary Article
Version
General
Subject Tags
Code
Assets
All else
Copyright 2016-2026, GDQuest
Created
2026/02/16
Updated
2025/12/27

Basis

In 3D space, a basis represents the rotation and scale part of a transform. It defines an object's orientation and size through three perpendicular vectors (axes) that form a coordinate system: the object's own x, y, and z axes.

You can think of a basis as describing "which way is up, right, and forward" for an object in your 3D world. You can also stretch or shrink these axes to scale the object along each direction.

The basis is represented by the Basis type in Godot. All 3D nodes have a basis property that you can access and modify to change the object's orientation and scale (this is a shortcut for transform.basis, which is the same value).

The basis has three Vector3 properties accessible like this:

  1. basis.x: The right direction (x-axis)
  2. basis.y: The up direction (y-axis)
  3. basis.z: The forward/back direction (z-axis)

Here's an example showing a common way to use the basis to move a character in 3D space. Here the character can move forward and back or strafe left and right based on its orientation:

func _process(delta: float) -> void:
	var direction: Vector3 = Vector3.ZERO
	if Input.is_action_pressed("move_forward"):
		direction -= transform.basis.z
	if Input.is_action_pressed("move_backward"):
		direction += transform.basis.z
	if Input.is_action_pressed("move_right"):
		direction += transform.basis.x
	if Input.is_action_pressed("move_left"):
		direction -= transform.basis.x
	direction = direction.normalized()

	position += direction * speed * delta
This video clip illustrates the basis in Godot

It's helpful to visualize the basis as the three colored axes you see when you select an object in the 3D editor. When you rotate an object, you're actually rotating these axes. When you scale it, you're changing the length of the axes.

Become an Indie Gamedev with GDQuest!

Don't stop here. Step-by-step tutorials are fun but they only take you so far.

Try one of our proven study programs to become an independent Gamedev truly capable of realizing the games you’ve always wanted to make.

Nathan

Founder and teacher at GDQuest
  • Starter Kit
  • Learn Gamedev from Zero
Check out GDSchool

You're welcome in our little community

Get help from peers and pros on GDQuest's Discord server!

20,000 membersJoin Server

Contribute to GDQuest's Free Library

There are multiple ways you can join our effort to create free and open source gamedev resources that are accessible to everyone!