xamarin/urho

Question about left hand coordinates

Closed this issue · 2 comments

This is probably a newbie misunderstanding, but I have a question about the default UrhoSharp coordinates. In the Conventions section of the Urho3D documentation it says:

  • Left-handed coordinates. Positive X, Y & Z axes point to the right, up, and forward, and positive rotation is clockwise.

However, when using the UrhoSharp implementation I see positive X pointing to the left. Positive Y & Z do indeed point up and forward.

This is driving me crazy because I am trying to port code from an iOS SceneKit implementation and there the coordinates are left handed as described in the above conventions.

Here is the code that is setting the scene up:

	scene = new Scene();
	octree = scene.CreateComponent<Octree>();

	universeNode = scene.CreateChild();
	universeNode.SetScale(Const.SCENE_SCALE);

	cameraPanNode = scene.CreateChild();
	CameraNode = cameraPanNode.CreateChild();
	camera = CameraNode.CreateComponent<Camera>();
	CameraNode.Position = new Vector3(0, 0, Const.DEFAULT_POV_DISTANCE * Const.SCENE_SCALE);

Can someone help me understand what is going on here? I don’t have any code anywhere (to my knowledge) that would flip the coordinate system.

If this is they way it is in UrhoSharp by default, is there a simple way to change it?

The coordinate system does indeed function as described on the box, with X increasing to the right of screen. Can you share some more code that draws something on the screen?

OK, I think I have resolved this. Apparently SceneKit uses a right hand coordinate system while Urho uses a left handed one. That explains the discrepancy and my confusion.