# Anim8or Community

• March 27, 2023, 07:16:24 pm
• Welcome, Guest

### News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Pages: [1]

#### NickD

• Newbie
• Posts: 25
« on: December 02, 2008, 05:22:28 am »

Hello,
I have two points. I want to connect them not with the line, but with the cylinder. Is this possible ?
Logged

#### NickD

• Newbie
• Posts: 25
« Reply #1 on: December 02, 2008, 09:12:12 am »

I've tried this:

....

....

float \$rx, \$ry, \$rz;
point3 \$p1, \$p2;
\$p1 = \$mymesh.GetPoint(\$index[0]);
\$p2 = \$mymesh.GetPoint(\$index[1]);
float \$CylLen;
\$CylLen = sqrt(pow(\$p1.x-\$p2.x, 2) + pow(\$p1.y-\$p2.y, 2) + pow(\$p1.z-\$p2.z, 2));
shape \$cyl0;
\$cyl0.lon = 8;
\$cyl0.lat = 1;
\$cyl0.CapStart = 0;
\$cyl0.CapEnd = 0;
\$cyl0.loc = (\$p2.x, \$p2.y, \$p2.z);

\$rx = 0;

if((\$p1.x-\$p2.x) < 0) { \$ang = 180; } else { \$ang = 0; }
\$ry = \$ang + atan((\$p1.z-\$p2.z)/(\$p1.x-\$p2.x)) * 180.0 / \$PI2;
\$rz = acos((\$p1.y-\$p2.y) / \$CylLen ) * 180.0 / \$PI2;
\$cyl[\$i].orientation = RPYtoQuaternion(\$rx, \$ry, \$rz);

it ALMOST works. The cylinder is positioned not very precise.
« Last Edit: December 02, 2008, 11:08:10 am by NickD »
Logged

#### NickD

• Newbie
• Posts: 25
« Reply #2 on: December 02, 2008, 09:27:32 am »

now everything works ok, i'm using old version of anim8or with wrong PI!
« Last Edit: December 02, 2008, 11:06:15 am by NickD »
Logged

#### RudySchneider

• Sr. Member
• Posts: 445
• There are no problems, only opportunities
« Reply #3 on: December 02, 2008, 11:17:15 am »

I haven't got ANY experience with Anim8or scripts but, just out of curiosity, doesn't \$CylRad need to be defined somewhere?
Logged
G

#### NickD

• Newbie
• Posts: 25
« Reply #4 on: December 03, 2008, 05:58:47 am »

yes, but i've not included this in the sample:

float \$PI2;
\$PI2 = 3.14159265358979323846;

actually, i'm using this script to build a geodesic dome

soon i will finish script and can publish it if someone  is interested.

This is the result of the script:

« Last Edit: December 03, 2008, 06:05:34 am by NickD »
Logged

• Full Member
• Posts: 108
« Reply #5 on: December 03, 2008, 06:45:29 pm »

I love geodesics and would love a copy once you're done.
Logged

#### dajean

• Newbie
• Posts: 43
• Creativity
« Reply #6 on: December 08, 2008, 08:09:03 pm »

I can't wait to try out your script NickD
Logged

#### NickD

• Newbie
• Posts: 25
« Reply #7 on: December 09, 2008, 05:33:04 am »

This is the scripts:
dome_5_8.txt - 5/8 simple geodesic dome
dome_6_8.txt - 6/8 simple geodesic dome
new-dome_5_8.txt - 5/8 geodesic dome with construction elements (cylinders on edges and spheres connecting the cylinders)
Logged

• Full Member
• Posts: 182