POV-Ray : Newsgroups : povray.advanced-users : Point at a vector; angles for rotation on axes X and Y /w nonzero origin : Point at a vector; angles for rotation on axes X and Y /w nonzero origin Server Time
28 Jul 2024 12:32:20 EDT (-0400)
  Point at a vector; angles for rotation on axes X and Y /w nonzero origin  
From: Mike C
Date: 16 Aug 2005 13:40:00
Message: <web.43022440433cdf6544365ed70@news.povray.org>
Hi all,

First, apologies in advance if this is in the wrong group or previously
posted -- I tried searching and looking in the archives, and couldn't find
anything.  Maybe I didn't search hard enough.

Anyways, I have two objects, one a cylinder pointing at positive Z, and a
semisphere pointing at Y with a cutout of it holding above said cylinder
(although it's "front" is at Z for the purpose of this discussion).  These
are translated off of the origin.

[Anyone who is interested, the object is supposed to represent a sort of
cannon or gun on a spaceship or other ship.]

Anyways, I want to rotate the cylinder (barrel of the gun) on the X and Y
axes to point at a Vector, and I want the associated semisphere ("body" of
the gun, I suppose?) to rotate the same amount on the Y axis, but not to
rotate in any other way.  These calculations, I'm hoping, should be based
on the vector of the cylinder's location (which could be stored in a
seperate variable), as opposed to the origin, or at least, when translated,
will end up pointing at the intended destination.

There will be two sets of objects (handled independantly), both pointing at
the same vector from two different locations.

I am aware of the Point_At_Trans and Reorient_Trans, but I can't get them to
work properly; either the objects end up pointing the wrong way, or they
don't translate to the spot I want them in.

Hopefully this makes sense; my thinking is a tad unclear today.

Thanks in advance for any response.

~Michael Chang


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.