look down Z

hello all. i want to place my view so i am looking down the Z sitting on Z

view.getTransform().lookAt(new Vector3f(0, 0, 1), new Vector3f(0, 0, 0), new Vector3f(0, 1, 0));

seems to look down at my object from the top.

just need to get me head around this lookat thing…

That should be correct. Are you sure you oriented your model correctly?

humm seems 3dsmax has its xyz mixed up- simple to change ;D - bink!

thanks for the conformation. thought i was going mad.

[quote]humm seems 3dsmax has its xyz mixed up- simple to change ;D - bink!
[/quote]
yep :slight_smile:

Will.

And now it’s even easier (this change is currently in CVS).

Those using the getTransformGroupTree simply have to pass the flag AseGeom.TGT_ROTATE90. Everything is exactaly the same except that the TG you would usually get is rotated 90 degrees and added as a child of a new one which is returned.

Aside:

Incidentally even if you don’t want to use TransformGroupTrees you can still use that method. Add the returned TG to your scene but only transform the geometry (ie. not the groups). ie. for this tute: http://xith.org/tutes/GettingStarted/html/transformgroup_trees_with_t.html

you would use “BodyGeom” instead of “Body”.

Of course don’t use the TGT_GROUP_ONLY flag with this!

The reason I say this is that if your group relationships are defined somewhere else (for example in ODE) you don’t want to use them in Xith3D. The pivots are still important however which is why the above methods works nicely :slight_smile:

Those instructions will make there way into an Ase Loader / odejava GSG tutorial early next year.

Will.

I’ve now added some more code so that you can rotate your model any XYZ amount after loading it. TGT_ROTATE90 still works to correct the Max->Xith3d issues. You can now pass a Vector3f into getTransformGroupTree.

I find this useful if for any reason the models I am loading are 90/180 degrees in the wrong direction for whatever reason.

I also did some code cleanup - adding in license and copyrights. getNamedNodes is deprecated because it uses a combersome Hashtable and doesn’t deal with *GROUP’s very well. getNamedNodesMap solves both those issues - please switch to that one before getNamedNodes is deleted totally :slight_smile:

Will.