POV-Ray : Newsgroups : povray.binaries.animations : can someone please point me to ... Server Time
20 Jul 2024 13:15:47 EDT (-0400)
  can someone please point me to ... (Message 1 to 6 of 6)  
From: Jan Walzer
Subject: can someone please point me to ...
Date: 17 Jan 2001 18:14:38
Message: <3a66275e@news.povray.org>
the post where someone had a fancy ball flying around and some kind of
"guns" followed him ...

I know it was here a VERY long time ago, and I don't know from whom it was,
but he must have used a macro that takes an location and a target as vectors
and gives back some rotations ...

If someone knows what I mean, please tell me, where I have to look at ...

I have to admit, that I'm currently to lazy to figure this out myself ...
AFAIK it goes like a conversion of cartesian coordinates to polar
coordinates ...
it was something with atan, but IIRC there have been some special cases to
handle when something like x/y was zero ...

I'd prefer to find a macro (of course, I'm sure there is one) ....

ThanX ... Jan

--
Jan Walzer


Post a reply to this message

From: Chris Huff
Subject: Re: can someone please point me to ...
Date: 17 Jan 2001 18:40:25
Message: <chrishuff-D794A1.18412817012001@news.povray.org>
Paul Daniel Jones <pdj### [at] psuedu>    auto-tracking [594 Kb]  11303   
10/4/00 7:26 AM
Message-ID: <39DB2206.198A1493@psu.edu>

The message didn't mention anything about the source code though...it 
just mentioned that it was going to be used in a scene.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Mark Wagner
Subject: Re: can someone please point me to ...
Date: 18 Jan 2001 02:13:04
Message: <3a669780@news.povray.org>
Jan Walzer wrote in message <3a66275e@news.povray.org>...
>the post where someone had a fancy ball flying around and some kind of
>"guns" followed him ...
>
>I know it was here a VERY long time ago, and I don't know from whom it was,
>but he must have used a macro that takes an location and a target as
vectors
>and gives back some rotations ...


I wrote a couple of macros to do that:

#macro Bearing(__Location, __Target)
 degrees(atan2((__Location.z-__Target.z),-(__Location.x-__Target.x)))
#end
#macro Elevation(__Location, __Target)

degrees(atan2((__Target.y-__Location.y),sqrt(sqr(__Location.x-__Target.x)+sq
r(__Location.z-__Target.z))))
#end


Bearing() gives you the rotation around the y axis for the gun turret, and
Elevation() gives you the rotation about the z axis for the gun.  Example:
Your gun turret is at <1,2,3>, and you are shooting at a target at <-5,4,7>:

union{
    object{GunBarrel rotate z*Elevation(<1,2,3>,<-5,4,7>)}
    object{GunTurret}
    rotate y*Bearing(<1,2,3>,<-5,4,7>)
    translate <1,2,3>
}

--
Mark


Post a reply to this message

From: Jan Walzer
Subject: Re: can someone please point me to ...
Date: 18 Jan 2001 04:19:12
Message: <3a66b510$1@news.povray.org>
Thanx a lot ...

Jan


Post a reply to this message

From: m o p s
Subject: macro putto
Date: 22 Jan 2001 06:05:52
Message: <3a6c1410@news.povray.org>
I recently rewrite a macro to easily place an object maybe it can help you
or inspire you

The syntax is like :

object { Yourobject transform
putto(refA,refB,norm1,newA,newB,norm2,option) }

refA and ref B  : two points used as starting position
norm1 : if the object need to be oriented this vector is orthogonal to
vector(ptB-ptA)

newA , new B ,norm2  : final position
option : scling type ( 0 uniform scaling )

example :
"fleche" is an arrow build between the points -1*x, 1*x
to place it between two points A and B write :

object { fleche transform putto(-1*x,1*x,0,A,B,0,0) material { example }}

"normal vector" are 0 because fleche don't need orientaion : it is an object
of revolution

I use this macro a lot to copy a same object between multiple position.

I hope this could help

Sorry for my english


Post a reply to this message


Attachments:
Download 'img0.jpg' (3 KB) Download 'img1.jpg' (3 KB) Download 'img2.jpg' (5 KB) Download 'macroputto.inc.txt' (7 KB) Download 'mopspatch.inc.txt' (15 KB) Download 'putto_ex.pov.txt' (4 KB)

Preview of image 'img0.jpg'
img0.jpg

Preview of image 'img1.jpg'
img1.jpg

Preview of image 'img2.jpg'
img2.jpg

From: Bob H 
Subject: Re: macro putto
Date: 22 Jan 2001 11:32:47
Message: <3a6c60af$1@news.povray.org>
Hi m.o.p.s.

Could you please cancel your post here at povray.binaries.animations?  The
message would be better placed at povray.binaries.scene-files group instead of
here.  I see that Thorsten Froehlich has already moved your other message post
to povray.general but it really belongs at povray.binaries.scene-files in
whole.  Separate images going to povray.binaries.images with a mention of the
p.b.s-f. message might be another thing to do.

Thanks.

Bob H.


Post a reply to this message

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