Page 1 of 1
How to OGRE auto calculation points ...
Posted: Sun Aug 10, 2025 5:52 pm
by marc_256
Hi,
For my robot arm simulator,
I need to position an axis of 800 mm length, between 2 (X,Y,Z) known points.
I tried to calculate the angles,
So I have one ref. point and pitch, yaw, roll of the object.
But, it seems not so correct way.
Q) Is there a way to enter the 2 (X,Y,Z) points and OGRE calculates the angles itself ?
Thanks,
Marc

Re: How to OGRE auto calculation points ...
Posted: Sun Aug 10, 2025 6:14 pm
by miso
Hello marc_256!
(First of all, your program looks very professional, opinion based not on this image, but on overall what I saw in the past.

)
Regarding the question. Nomally Entity rotations are based on the created mesh origo (0,0 vertice position). I mean if your dimensions for the mesh vertices positioned -10 to +10 then it is centered. If your vertices are +10 -+20, then it would still rotate around the origo. I know that you are good in 3d math, I'm not that much. For me translating the coordinates would be a lot of manual computation.
pb+Ogre offers nodes and joints though, and entities can be attached to them. Those can be animated.
As I'm always thinking about games when looking for solutions, I would use those.
Theres also a skeleton library with manually built bones. You don't have to bend your vertices with them. You can assign all of a robot part fully to a bone with weight 1 to make it rigid.
Those would reduce the needed computations for even a mere mortal like me to use it.
Re: How to OGRE auto calculation points ...
Posted: Sun Aug 10, 2025 8:09 pm
by pf shadoko
If you just need to orient your entity, use:
EntityDirection with coordinates x y z, the difference p1- p2
Re: How to OGRE auto calculation points ...
Posted: Sun Aug 10, 2025 9:07 pm
by marc_256
@miso,
Yes, I think you gave me a good idea.
I gone try to use bones, I never did, so need some exercises ...
@pf shadoko,
I think, this gone give me the same error as my calculations.
So, gone first try bones ...
Thanks for yours inputs.
Marc
Re: How to OGRE auto calculation points ...
Posted: Mon Aug 11, 2025 5:28 am
by miso
@mark_256
Alternatively, you don't even have to assign your vertices. Create a mesh with 1 vertices, build your skeleton + bone hierarchy. When finished and created an entity, you can attach/detach entitites to a bone. Also, bones can be manipulated manually, so you don't have to create so called "animations", as I think thats not something you are looking for.
Unfortunately the lib is poorly documented, but works, and pretty straightforward none the less. Nodes could be also good for you as an alternative.
Also, they skeleton lib is not presented in 5.73, its a later addition.