Repository: godotengine/godot
File: editor/plugins/node_3d_editor_plugin.cpp (C++)

Code before:
			undo_redo->commit_action();
		} break;
	}
}

void Node3DEditor::_init_indicators() {
	{
		origin_enabled = true;
		grid_enabled = true;

		indicator_mat.instance();
		indicator_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
		indicator_mat->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
		indicator_mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
		indicator_mat->set_transparency(StandardMaterial3D::Transparency::TRANSPARENCY_ALPHA_DEPTH_PRE_PASS);

		Vector<Color> origin_colors;
		Vector<Vector3> origin_points;

		for (int i = 0; i < 3; i++) {
			Vector3 axis;
			axis[i] = 1;
			Color origin_color;
			switch (i) {
				case 0:
					origin_color = get_theme_color("axis_x_color", "Editor");
					break;
				case 1:
					origin_color = get_theme_color("axis_y_color", "Editor");
					break;
				case 2:
					origin_color = get_theme_color("axis_z_color", "Editor");
					break;
				default:
					origin_color = Color();
					break;
			}

			grid_enable[i] = false;
			grid_visible[i] = false;

			origin_colors.push_back(origin_color);
			origin_colors.push_back(origin_color);
			origin_colors.push_back(origin_color);
			origin_colors.push_back(origin_color);
			origin_colors.push_back(origin_color);
			origin_colors.push_back(origin_color);
			// To both allow having a large origin size and avoid jitter
			// at small scales, we should segment the line into pieces.
			// 3 pieces seems to do the trick, and let's use powers of 2.
			origin_points.push_back(axis * 1048576);

Review comment (suggestion):
```suggestion
				"	vec3 dir = orthogonal ? -vec3(0, 0, 1) : VIEW; \n"
```

Code after:
		origin_enabled = true;
		grid_enabled = true;

		indicator_mat.instance();
		indicator_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED);
		indicator_mat->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true);
		indicator_mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true);
		indicator_mat->set_transparency(StandardMaterial3D::Transparency::TRANSPARENCY_ALPHA_DEPTH_PRE_PASS);

		Vector<Color> origin_colors;
		Vector<Vector3> origin_points;

		for (int i = 0; i < 3; i++) {
			Vector3 axis;
			axis[i] = 1;
			Color origin_color;
			switch (i) {
				case 0:
					origin_color = get_theme_color("axis_x_color", "Editor");
					break;
				case 1:
					origin_color = get_theme_color("axis_y_color", "Editor");
					break;
				case 2:
					origin_color = get_theme_color("axis_z_color", "Editor");
					break;
				default:
					origin_color = Color();
					break;
			}

			grid_enable[i] = false;
			grid_visible[i] = false;

			origin_colors.push_back(origin_color);
			origin_colors.push_back(origin_color);
			origin_colors.push_back(origin_color);
			origin_colors.push_back(origin_color);
			origin_colors.push_back(origin_color);
			origin_colors.push_back(origin_color);
			// To both allow having a large origin size and avoid jitter
			// at small scales, we should segment the line into pieces.
			// 3 pieces seems to do the trick, and let's use powers of 2.
			origin_points.push_back(axis * 1048576);
			origin_points.push_back(axis * 1024);
			origin_points.push_back(axis * 1024);
			origin_points.push_back(axis * -1024);
			origin_points.push_back(axis * -1024);
			origin_points.push_back(axis * -1048576);
		}