Jump to content
Developer Wiki and Function Reference Links ×

SetRot3D() broken?


Guest

Recommended Posts

Guest Mark Flamer

Can someone try this code and tell me if it's behaving as expected. I've been having trouble with combinations of move then rotate in a much larger and complex script. Wondering if its me or a bug. Thanks.

PROCEDURE Main;

VAR

hnd : HANDLE;

BEGIN

hnd := CreateCone(0, 0, 0, 0, 0, 1, .5);

Move3DObj(hnd, 2, 0, 2);

SetRot3D(hnd, 0, 45,0,0,0,0);

END;

RUN(Main);

Link to comment

Hi Mark,

???It's working as it always has, but there is a bug where SetRot3D moves some objects back to the origin (like your cone) and other objects back to the place they were created (like Extrudes) before applying the rotation. This is better seen with an Extrude that is created in one position then moved to another. If you perform SetRot3D on it, it will jump back to it's creation position then rotate.

I thought I submitted a bug several years ago, but I may be mistaken. In either case nothing's changed. The good news is you can work around it.

In your case, you can rotate first then move it to get the cone's base at (2, 0, 2).

hnd := CreateCone(0, 0, 0, 0, 0, 1, .5);

SetRot3D(hnd, 0, 45, 0, 0, 0, 0);

Move3DObj(hnd, 2, 0, 2);

Or you can use Set3DRot() which applies an incremental rotation:

hnd := CreateCone(0, 0, 0, 0, 0, 1, .5);

Move3DObj(H, 2, 0, 2);

Set3DRot(H, 0, 45, 0, 2, 0, 2);

Remember to specify the point of rotation in the Set3DRot() call if you move it or create it away from the origin.

HTH,

Raymond

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...