I’m new to graphics. I’m experimenting with OpenGL / JOGL.
I have a .obj file that I’m rendering. I’m having difficulty placing it exactly where I want it in the world. I have a plane that I want it to rest on, taking into account the model’s runtime-set size. Just doing a transformation isn’t quite enough, because I need to take into account the model’s dimensions.
Even then, I’m not sure how to translate 0 in the .obj’s frame of reference to the world coordinate system.
What is the idiomatic pattern for dealing with this?
You should set your model’s origin at its feet, and approx. under its gravity center. This way, when you scale it, its position (relatively to the ground) won’t change.
Then, simply translate it where you want it to be, then rotate, then scale (in this order) – you’re done.