Function to get the position and orientation of the marker?

Mar 27, 2012 at 2:35 AM

Hi,

I want to use the toolbar as a navigator to the 3DUI(Groundmarker). For example, when I rotate the toolbar the Object on the ground would rotate at the same time. Thus I would like to know is there any function to get the position and orientation of the toolbar?

Coordinator
Mar 27, 2012 at 8:31 PM

toolbarMarkerNode.WorldTransformation.Decompose(.......) method will decompose the marker transformation into translation, rotation, and scale

Ohan

Mar 28, 2012 at 7:15 PM

Thanks a lot!

Mar 29, 2012 at 7:13 AM

Hi,

I try to make the selected object move in X axis when the toolbar moves and wrote below:

Vector3 x = new Vector3();

Vector3 y = new Vector3();           

Quaternion outRotation;           

toolbarMarkerNode.WorldTransformation.Decompose(out x, out outRotation, out y);

sphereTransNode.Translation.X = x.X;

But there is an error called "Cannot modify the return value of 'GoblinXNA.SceneGraph.TransformNode.Translation' because it is not a variable "

Could u explain for me why that happen and how could I fix it?

Coordinator
Mar 29, 2012 at 5:54 PM

That's C# thing that you can't modify property's member field, so you need to modify .Translation itself. All of your questions are C# and XNA related, and I prefer not to answer questions that are not specific to GoblinXNA.

Ohan