|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Say I have a cylinder which goes from 0, to <0, h, 0> and I want to
transform it so that it runs from <a,b,c> to <x,y,z>. How do I go about
figuring out that transformation?
Thanks,
Darcy
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Darcy Johnston" <djo### [at] inamecomNOSPAM> writes:
> Say I have a cylinder which goes from 0, to <0, h, 0> and I want to
> transform it so that it runs from <a,b,c> to <x,y,z>. How do I go about
> figuring out that transformation?
Perhaps you should have a look at my "segment" include file. It's not
exactly what you looking for, but close to it. You can find the zip
file at http://www.fmi.uni-konstanz.de/~willhalm/graphics/povaddon/
Thomas
--
http://thomas.willhalm.de/ (includes pgp key)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi Darcy,
Darcy Johnston wrote:
>
> Say I have a cylinder which goes from 0, to <0, h, 0> and I want to
> transform it so that it runs from <a,b,c> to <x,y,z>. How do I go about
> figuring out that transformation?
>
> Thanks,
> Darcy
Well, I wouldn't try to re-invent the wheel, so ...
Given S == vlength(<a,b,c>-<x,y,z>)
1) Scale your object by S/h or <1,S,1>/h depending whether you want to
keep the proportions consistent.
2) Apply one of the reorientation macros to the object. The two I can
remember are in John VanSickle's Thoroughly Useful Macros and Gilles
Tran's tree generator, either of which should do the trick.
Hope this helps,
Mike Andrews.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
http://users.erols.com/vansickl/matrix.htm
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I had three orientation macros but I can only find two of them:
#macro Orient_X(v1,v2)
#local nx = vnormalize(v2 - v1);
#local nz = vnormalize(vcross(nx,y));
#local ny = vcross(nz,nx);
matrix <nx.x,nx.y,nx.z,
ny.x,ny.y,ny.z,
nz.x,nz.y,nz.z,
v1.x,v1.y,v1.z>
#end
#macro Orient_Z(v1,v2)
#local nz = vnormalize(v2 - v1);
#local nx = vnormalize(vcross(nz,y));
#local ny = vcross(nz,nx);
matrix <nx.x,nx.y,nx.z,
ny.x,ny.y,ny.z,
nz.x,nz.y,nz.z,
v1.x,v1.y,v1.z>
#end
I have no idea what happened to Orient_Y
I think if you use
#local ny = vnormalize(v2 - v1);
#local nz = vnormalize(vcross(x,nz));
#local nx = vcross(nz,ny);
it will work. Instead of x you can use any vector that you want to be "to
the right of" the object before it gets adjusted.
This is what I use.
Darcy Johnston wrote:
> Say I have a cylinder which goes from 0, to <0, h, 0> and I want to
> transform it so that it runs from <a,b,c> to <x,y,z>. How do I go about
> figuring out that transformation?
>
> Thanks,
> Darcy
--
Josh English
eng### [at] spiritonecom
ICQ: 1946299
"Stress is when you wake up screaming and realize you haven't fallen
asleep yet."
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Try VanSickle's macro http://users.erols.com/vansickl/matrix.htm or my own
Reposition macro which is at my homepage.
--
Homepage: http://www.faricy.net/~davidf/
___ ______________________________
| \ |_ <dav### [at] faricynet>
|_/avid |ontaine <ICQ 55354965>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|