Easy Questioning, Centering a Model Upon Creation.

I wanted to place this post in the general forum but the, “post new thread” button is not visible there right now. I have a world that is made up of triangles, to be able to rotate this world and also a ball model, do I need to center these objects upon creation of the models? Keep it easy please.

Thanks,

Josheir

If by center them, you mean place the coordinate origin (0,0,0) at or near the object when modeling, then yes, that makes them easier to place in your scene later. However, this is not strictly required.

If you don’t do this, then somehow you’ve got to communicate to the program later what the origin point of your object is, because it’s not (0,0,0).

For similar reasons, it helps to orient your model in a standard orientation w.r.t. the axes when modeling it.

I’m new at this. What I mean is that when I create the world object (with for loops) the center of the object must be at its (0,0,0.) Otherwise when I rotate I get some lopsided effect. By communicating later what do you mean exactly? Alter all the points with a for loop, or something? I thought I understood this but I am also confused with “at or near the object.” How it would be effective to be closer to a center?

Thank you,

Josheir

“Comprehending what’s needed results in the most gain and understanding.”

Right. That’s exactly what I meant.

By communicating later what do you mean exactly?

That is, along with the model, you’d have to provide the special point (e.g. (3,5,10), or whatever) that should be used as the rotation center for the object, if not (0,0,0). The program loading the model could then rotate the object about this point rather than (0,0,0).

But if you just pre-position the model so that the desired rotation center is (0,0,0), then there’s no need to provide this point, or for the program to do anything special when rotating the object.

I thought I understood this but I am also confused with “at or near the object.” How it would be effective to be closer to a center?

Nothing complicated here. All I meant by “at or near the object” is that you don’t have to position the coordinate origin (0,0,0) at the exact center of your object. It might be useful for it to be elsewhere in some cases.

For instance, suppose you had a model for a 3D pointer. Perhaps you’d want to position it so that the tail of the 3D pointer is at the origin. Then when you load it into a program and rotate it about the origin, its tail stays at the origin and it just points a different direction.

If you have access to the vertices you can go through them all and figure out what the AABB for the model is.
Then you can calculate the center of the AABB and remove that from all vertices, this will center it on it’s extents.