Subject:
|
Re: New Part: x784 Technic Gear Hailfire Droid Wheel
|
Newsgroups:
|
lugnet.cad.dat.parts
|
Date:
|
Thu, 1 Dec 2005 16:34:49 GMT
|
Viewed:
|
3777 times
|
| |
| |
To make the Hailfire Gear, I modeled one segment with one fin in 3DS Max. I
exported it with the script I previously posted. Then, I spun the segment around
with the following code. I also spun in 168 teeth from the gear tooth
primative.
// Hailfire generation code C++
#include "stdafx.h"
#include "math.h"
int _tmain(int argc, _TCHAR* argv[])
{
double x;
double pi=3.14159;
double fin_deg = 3.75;
double tooth_deg = 2.142857;
printf("0 Technic Gear Hailfire Droid Wheel Segment of 12 fin units\n");
printf("0 Name: x784s02.dat\n");
for (x=0; x<8;x++){
double ang;
ang=x*fin_deg*pi/180.0;
printf("1 16 0 0 0 %f %f 0 %f %f 0 0 0 1
s\\x784s01.dat\n",cos(ang),-sin(ang),sin(ang),cos(ang));
}
printf("0 Technic Gear Hailfire Inner Tooth Segment of 14 teeth\n");
printf("0 Name: x784s03.dat\n");
double teeth_radius = 215;
double tooth_x,tooth_y;
for (x=0; x<14;x++){
double ang;
ang=x*tooth_deg*pi/180.0;
tooth_x=sin(ang)*teeth_radius;
tooth_y=-cos(ang)*teeth_radius;
printf("1 16 %f %f 0 %f %f 0 %f %f 0 0 0 1
..\\p\\tooth24.dat\n",tooth_x,tooth_y,cos(ang),-sin(ang),sin(ang),cos(ang));
}
printf("0 Technic Gear Hailfire Droid Wheel\n");
printf("0 Name: x784.dat\n");
// Fins
for (x=0; x<12;x++){
double ang;
ang=x*fin_deg*pi/180.0*8;
printf("1 16 0 0 0 %f %f 0 %f %f 0 0 0 1
s\\x784s02.dat\n",cos(ang),-sin(ang),sin(ang),cos(ang));
}
// Teeth
for (x=0; x<12;x++){
double ang;
ang=x*tooth_deg*pi/180.0*14.0;
printf("1 16 0 0 0 %f %f 0 %f %f 0 0 0 1
s\\x784s03.dat\n",cos(ang),-sin(ang),sin(ang),cos(ang));
}
return 0;
}
|
|
Message is in Reply To:
25 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|