本文整理匯總了C++中ELL_3V_SET函數的典型用法代碼示例。如果您正苦於以下問題:C++ ELL_3V_SET函數的具體用法?C++ ELL_3V_SET怎麽用?C++ ELL_3V_SET使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ELL_3V_SET函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: _echoRayIntx_Cube
int
_echoRayIntx_Cube(RAYINTX_ARGS(Cube)) {
echoPos_t t;
int ax, dir;
AIR_UNUSED(parm);
if (!_echoRayIntx_CubeSurf(&t, &ax, &dir,
-1, 1,
-1, 1,
-1, 1, ray))
return AIR_FALSE;
intx->obj = (echoObject *)obj;
intx->t = t;
switch(ax) {
case 0: ELL_3V_SET(intx->norm, dir, 0, 0); break;
case 1: ELL_3V_SET(intx->norm, 0, dir, 0); break;
case 2: ELL_3V_SET(intx->norm, 0, 0, dir); break;
}
intx->face = ax + 3*(dir + 1)/2;
if (tstate->verbose) {
fprintf(stderr, "%s%s: ax = %d --> norm = (%g,%g,%g)\n",
_echoDot(tstate->depth), "_echoRayIntx_Cube", ax,
intx->norm[0], intx->norm[1], intx->norm[2]);
}
/* does NOT set u, v */
return AIR_TRUE;
}
示例2: makeSceneGlass2
void
makeSceneGlass2(limnCamera *cam, echoRTParm *parm, echoObject **sceneP) {
echoObject *cube, *rect;
echoObject *scene;
Nrrd *ntext;
echoPos_t matx[16];
*sceneP = scene = echoObjectNew(echoList);
ELL_3V_SET(cam->from, 0, 0, 100);
ELL_3V_SET(cam->at, 0, 0, 0);
ELL_3V_SET(cam->up, 0, 1, 0);
cam->uRange[0] = -1.0;
cam->uRange[1] = 1.0;
cam->vRange[0] = -1.0;
cam->vRange[1] = 1.0;
parm->jitterType = echoJitterNone;
parm->numSamples = 1;
parm->imgResU = 300;
parm->imgResV = 300;
parm->aperture = 0.0;
parm->renderLights = AIR_FALSE;
parm->shadow = 0.0;
parm->seedRand = AIR_FALSE;
parm->maxRecDepth = 10;
parm->mrR = 1.0;
parm->mrG = 0.0;
parm->mrB = 1.0;
ELL_4M_SET_SCALE(matx, 0.5, 0.5, 0.5);
cube = echoRoughSphere(80, 40, matx);
/*
cube = echoObjectNew(echoSphere);
echoSphereSet(cube, 0, 0, 0, 0.5);
*/
echoMatterGlassSet(cube,
1.0, 1.0, 1.0,
1.33333, 0.0, 0.0);
echoObjectAdd(scene, cube);
nrrdLoad(ntext=nrrdNew(), "check.nrrd", NULL);
rect = echoObjectNew(echoRectangle);
printf("rect = %p\n", rect);
echoRectangleSet(rect,
-1, -1, -0.51,
2, 0, 0,
0, 2, 0);
echoMatterPhongSet(rect, 1.0, 1.0, 1.0, 1.0,
0.0, 1.0, 0.0, 40);
echoMatterTextureSet(rect, ntext);
echoObjectAdd(scene, rect);
/*
light = echoLightNew(echoLightDirectional);
echoLightDirectionalSet(light, 1, 1, 1, 0, 0, 1);
echoLightArrayAdd(lightArr, light);
*/
}
示例3: incTest
void
incTest(char *me, int num, baneRange *range) {
double *val, tmp, incParm[BANE_PARM_NUM], omin, omax, rmin, rmax;
baneInc *inc;
Nrrd *hist;
int i, j;
airSrand48();
val = (double*)malloc(num*sizeof(double));
/* from <http://www.itl.nist.gov/div898/handbook/index.htm>:
the standard dev of a uniform distribution between A and B is
sqrt((B-A)^2/12) */
for (j=0; j<num; j++) {
tmp = AIR_AFFINE(0.0, airDrand48(), 1.0, -1.0, 1.0);
/* val[j] = tmp*tmp*tmp; */
val[j] = tmp;
}
rmin = rmax = val[0];
for (j=0; j<num; j++) {
rmin = AIR_MIN(rmin, val[j]);
rmax = AIR_MAX(rmax, val[j]);
}
fprintf(stderr, "incTest: real min,max = %g,%g\n", rmin, rmax);
for (i=1; i<baneIncLast; i++) {
/* NOTE: THIS IS BROKEN !!! */
inc = baneIncNew(i, NULL, incParm);
printf("%s: inclusion %s ------\n", me, inc->name);
switch(i) {
case baneIncAbsolute:
ELL_3V_SET(incParm, -0.8, 1.5, AIR_NAN);
break;
case baneIncRangeRatio:
ELL_3V_SET(incParm, 0.99, AIR_NAN, AIR_NAN);
break;
case baneIncPercentile:
ELL_3V_SET(incParm, 1024, 10, AIR_NAN);
break;
case baneIncStdv:
ELL_3V_SET(incParm, 1.0, AIR_NAN, AIR_NAN);
break;
}
fprintf(stderr, "!%s: THIS IS BROKEN!!!\n", "incTest");
/*
if (inc->passA) {
for (j=0; j<num; j++)
inc->process[0](hist, val[j], incParm);
}
if (inc->passB) {
for (j=0; j<num; j++)
inc->process[1](hist, val[j], incParm);
}
inc->ans(&omin, &omax, hist, incParm, range);
*/
printf(" --> (%g,%g)\n", omin, omax);
}
free(val);
}
示例4: hooverContextNew
hooverContext *
hooverContextNew() {
hooverContext *ctx;
ctx = (hooverContext *)calloc(1, sizeof(hooverContext));
if (ctx) {
ctx->cam = limnCameraNew();
ELL_3V_SET(ctx->volSize, 0, 0, 0);
ELL_3V_SET(ctx->volSpacing, AIR_NAN, AIR_NAN, AIR_NAN);
ctx->volCentering = hooverDefVolCentering;
ctx->shape = NULL;
ctx->imgSize[0] = ctx->imgSize[1] = 0;
ctx->imgCentering = hooverDefImgCentering;
ctx->user = NULL;
ctx->numThreads = 1;
ctx->workIdx = 0;
ctx->workMutex = NULL;
ctx->renderBegin = hooverStubRenderBegin;
ctx->threadBegin = hooverStubThreadBegin;
ctx->rayBegin = hooverStubRayBegin;
ctx->sample = hooverStubSample;
ctx->rayEnd = hooverStubRayEnd;
ctx->threadEnd = hooverStubThreadEnd;
ctx->renderEnd = hooverStubRenderEnd;
}
return(ctx);
}
示例5: _cap2xyz
void
_cap2xyz(double xyz[3], double ca, double cp, int version, int whole) {
double cl, cs, mean;
cs = 1 - ca;
cl = 1 - cs - cp;
mean = (cs + cp + cl)/3;
/*
xyz[0] = cs*0.333 + cl*1.0 + cp*0.5;
xyz[1] = cs*0.333 + cl*0.0 + cp*0.5;
xyz[2] = cs*0.333 + cl*0.0 + cp*0.0;
xyz[0] = AIR_AFFINE(0, ca, 1, 1.1*xyz[0], 0.86*xyz[0]);
xyz[1] = AIR_AFFINE(0, ca, 1, 1.1*xyz[1], 0.86*xyz[1]);
xyz[2] = AIR_AFFINE(0, ca, 1, 1.1*xyz[2], 0.86*xyz[2]);
*/
if (whole) {
ELL_3V_SET(xyz,
AIR_AFFINE(0.0, 0.9, 1.0, mean, cl),
AIR_AFFINE(0.0, 0.9, 1.0, mean, cp),
AIR_AFFINE(0.0, 0.9, 1.0, mean, cs));
ELL_3V_SET(xyz, cl, cp, cs);
} else {
if (1 == version) {
ELL_3V_SET(xyz,
(3 + 3*cl - cs)/6,
(2 - 2*cl + cp)/6,
2*cs/6);
} else {
ELL_3V_SET(xyz, 1, 1 - cl, cs);
}
}
}
示例6: _ra2t
void
_ra2t(Nrrd *nten, double rad, double angle,
double mRI[9], double mRF[9], double hack) {
double x, y, xyz[3], XX[3], YY[3], CC[3], EE[3], VV[3], tmp, mD[9], mT[9];
float *tdata;
int xi, yi, sx, sy;
sx = nten->axis[1].size;
sy = nten->axis[2].size;
x = rad*sin(AIR_PI*angle/180);
y = rad*cos(AIR_PI*angle/180);
xi = airIndexClamp(0.0, x, sqrt(3.0)/2.0, sx);
yi = airIndexClamp(0.0, y, 0.5, sy);
ELL_3V_SET(VV, 0, 3, 0);
ELL_3V_SET(EE, 1.5, 1.5, 0);
ELL_3V_SET(CC, 1, 1, 1);
ELL_3V_SUB(YY, EE, CC);
ELL_3V_SUB(XX, VV, EE);
ELL_3V_NORM(XX, XX, tmp);
ELL_3V_NORM(YY, YY, tmp);
ELL_3V_SCALE_ADD3(xyz, 1.0, CC, hack*x, XX, hack*y, YY);
ELL_3M_IDENTITY_SET(mD);
ELL_3M_DIAG_SET(mD, xyz[0], xyz[1], xyz[2]);
ELL_3M_IDENTITY_SET(mT);
ell_3m_post_mul_d(mT, mRI);
ell_3m_post_mul_d(mT, mD);
ell_3m_post_mul_d(mT, mRF);
tdata = (float*)(nten->data) + 7*(xi + sx*(yi + 1*sy));
tdata[0] = 1.0;
TEN_M2T(tdata, mT);
}
示例7: lattABtoXX
/* XX != AB */
static int
lattABtoXX(int dstLatt, double *dstParm, const double *srcParm) {
double AA[2], BB[2], theta, phase, radi, area, len;
int ret = 0;
/* we have to reduce the DOF, which always starts with the same
loss of orientation information */
ELL_2V_COPY(AA, srcParm + 0);
ELL_2V_COPY(BB, srcParm + 2);
getToPosY(AA, BB);
switch(dstLatt) {
case rvaLattPRA: /* AB -> PRA (loss off orientation) */
theta = atan2(BB[1], BB[0]);
phase = AIR_AFFINE(AIR_PI/2, theta, AIR_PI/3, 0.0, 1.0);
radi = _rvaLen2(BB)/_rvaLen2(AA);
area = _rvaLen2(AA)*BB[1];
ELL_3V_SET(dstParm, phase, radi, area);
break;
case rvaLattUVW: /* AB -> UVW (loss of orientation) */
ELL_3V_SET(dstParm, BB[0], BB[1], AA[0]);
break;
case rvaLattXY: /* AB -> XY (loss of orientation and scale) */
len = _rvaLen2(AA);
ELL_2V_SET(dstParm, BB[0]/len, BB[1]/len);
break;
default: ret = 1; break; /* unimplemented */
}
return ret;
}
示例8: washQtoM3
void
washQtoM3(double m[9], double q[4]) {
double p[4], w, x, y, z, len;
ELL_4V_COPY(p, q);
len = ELL_4V_LEN(p);
ELL_4V_SCALE(p, 1.0/len, p);
w = p[0];
x = p[1];
y = p[2];
z = p[3];
/* mathematica work implies that we should be
setting ROW vectors here */
ELL_3V_SET(m+0,
1 - 2*(y*y + z*z),
2*(x*y - w*z),
2*(x*z + w*y));
ELL_3V_SET(m+3,
2*(x*y + w*z),
1 - 2*(x*x + z*z),
2*(y*z - w*x));
ELL_3V_SET(m+6,
2*(x*z - w*y),
2*(y*z + w*x),
1 - 2*(x*x + y*y));
}
示例9: makeSceneDOF
void
makeSceneDOF(limnCamera *cam, echoRTParm *parm, echoScene *scene) {
echoObject *rect;
Nrrd *ntext;
ELL_3V_SET(cam->from, 6, 6, 20);
ELL_3V_SET(cam->at, 0, 0, 0);
ELL_3V_SET(cam->up, 0, 1, 0);
cam->uRange[0] = -3.3;
cam->uRange[1] = 3.3;
cam->vRange[0] = -3.3;
cam->vRange[1] = 3.3;
parm->jitterType = echoJitterJitter;
parm->numSamples = 4;
parm->imgResU = 300;
parm->imgResV = 300;
parm->aperture = 0.5;
parm->renderLights = AIR_FALSE;
parm->renderBoxes = AIR_FALSE;
parm->seedRand = AIR_FALSE;
parm->maxRecDepth = 10;
parm->shadow = 1.0;
nrrdLoad(ntext = nrrdNew(), "tmp.png", NULL);
rect = echoObjectNew(scene, echoTypeRectangle);
echoRectangleSet(rect,
-0.5, 1.5, -3,
2, 0, 0,
0, -2, 0);
echoColorSet(rect, 1, 0.5, 0.5, 1);
echoMatterPhongSet(scene, rect, 1.0, 0.0, 0.0, 1);
echoMatterTextureSet(scene, rect, ntext);
echoObjectAdd(scene, rect);
rect = echoObjectNew(scene, echoTypeRectangle);
echoRectangleSet(rect,
-1, 1, 0,
2, 0, 0,
0, -2, 0);
echoColorSet(rect, 0.5, 1, 0.5, 1);
echoMatterPhongSet(scene, rect, 1.0, 0.0, 0.0, 1);
echoMatterTextureSet(scene, rect, ntext);
echoObjectAdd(scene, rect);
rect = echoObjectNew(scene, echoTypeRectangle);
echoRectangleSet(rect,
-1.5, 0.5, 3,
2, 0, 0,
0, -2, 0);
echoColorSet(rect, 0.5, 0.5, 1, 1);
echoMatterPhongSet(scene, rect, 1.0, 0.0, 0.0, 1);
echoMatterTextureSet(scene, rect, ntext);
echoObjectAdd(scene, rect);
return;
}
示例10: _coilKind7TensorFilterFinish
void
_coilKind7TensorFilterFinish(coil_t *delta, coil_t **iv3,
double spacing[3],
double parm[COIL_PARMS_NUM]) {
coil_t rspX, rspY, rspZ,
rspsqX, rspsqY, rspsqZ;
double eval[3], evec[9], tens[7], tengrad[21], grad[3], LL, KK,
cnd,
dmu1[7], dmu2[7], dskw[7], phi3[7];
rspX = AIR_CAST(coil_t, 1.0/spacing[0]); rspsqX = rspX*rspX;
rspY = AIR_CAST(coil_t, 1.0/spacing[1]); rspsqY = rspY*rspY;
rspZ = AIR_CAST(coil_t, 1.0/spacing[2]); rspsqZ = rspZ*rspZ;
TENS(tens, iv3);
TENGRAD(tengrad, iv3, rspX, rspY, rspZ);
tenEigensolve_d(eval, evec, tens);
tenInvariantGradientsK_d(dmu1, dmu2, dskw, tens, 0.000001);
tenRotationTangents_d(NULL, NULL, phi3, evec);
/* \midhat{\nabla} \mu_1 ----------------- */
ELL_3V_SET(grad,
TEN_T_DOT(dmu1, tengrad + 0*7),
TEN_T_DOT(dmu1, tengrad + 1*7),
TEN_T_DOT(dmu1, tengrad + 2*7));
LL = ELL_3V_DOT(grad,grad);
KK = parm[1]*parm[1];
cnd = _COIL_CONDUCT(LL, KK);
/* \midhat{\nabla} \mu_2 ----------------- */
ELL_3V_SET(grad,
TEN_T_DOT(dmu2, tengrad + 0*7),
TEN_T_DOT(dmu2, tengrad + 1*7),
TEN_T_DOT(dmu2, tengrad + 2*7));
LL = ELL_3V_DOT(grad,grad);
KK = parm[2]*parm[2];
cnd *= _COIL_CONDUCT(LL, KK);
/* \midhat{\nabla} \skw and twist! ----------------- */
ELL_3V_SET(grad,
TEN_T_DOT(dskw, tengrad + 0*7),
TEN_T_DOT(dskw, tengrad + 1*7),
TEN_T_DOT(dskw, tengrad + 2*7));
LL = ELL_3V_DOT(grad,grad);
ELL_3V_SET(grad,
TEN_T_DOT(phi3, tengrad + 0*7),
TEN_T_DOT(phi3, tengrad + 1*7),
TEN_T_DOT(phi3, tengrad + 2*7));
LL += ELL_3V_DOT(grad,grad);
KK = AIR_CAST(coil_t, parm[3]*parm[3]);
cnd *= _COIL_CONDUCT(LL, KK);
delta[0]= 0.0f;
delta[1]= AIR_CAST(coil_t, parm[0]*cnd*LAPL(iv3, 1, rspsqX, rspsqY, rspsqZ));
delta[2]= AIR_CAST(coil_t, parm[0]*cnd*LAPL(iv3, 2, rspsqX, rspsqY, rspsqZ));
delta[3]= AIR_CAST(coil_t, parm[0]*cnd*LAPL(iv3, 3, rspsqX, rspsqY, rspsqZ));
delta[4]= AIR_CAST(coil_t, parm[0]*cnd*LAPL(iv3, 4, rspsqX, rspsqY, rspsqZ));
delta[5]= AIR_CAST(coil_t, parm[0]*cnd*LAPL(iv3, 5, rspsqX, rspsqY, rspsqZ));
delta[6]= AIR_CAST(coil_t, parm[0]*cnd*LAPL(iv3, 6, rspsqX, rspsqY, rspsqZ));
}
示例11: kgrads
/* normalized gradients of k or r invariants, in XYZ space,
to help determine if path is really a loxodrome */
void
kgrads(double grad[3][3], const double eval[3]) {
double rtz[3];
tenTripleConvertSingle_d(rtz, tenTripleTypeRThetaZ,
eval, tenTripleTypeEigenvalue);
ELL_3V_SET(grad[0], cos(rtz[1]), sin(rtz[1]), 0);
ELL_3V_SET(grad[1], -sin(rtz[1]), cos(rtz[1]), 0);
ELL_3V_SET(grad[2], 0, 0, 1);
}
示例12: wheelGeomToABC
void
wheelGeomToABC(double ABC[3], double center, double radius, double angle) {
double geom[3], x[3], yroot[3];
ELL_3V_SET(geom, center, radius, angle);
wheelGeomToRoot(x, yroot, geom);
ELL_3V_SET(ABC,
-x[0] - x[1] - x[2],
x[0]*x[1] + x[1]*x[2] + x[0]*x[2],
-x[0]*x[1]*x[2]);
return;
}
示例13: echoRectangleSet
void
echoRectangleSet(echoObject *rect,
echoPos_t ogx, echoPos_t ogy, echoPos_t ogz,
echoPos_t e0x, echoPos_t e0y, echoPos_t e0z,
echoPos_t e1x, echoPos_t e1y, echoPos_t e1z) {
if (rect && echoTypeRectangle == rect->type) {
ELL_3V_SET(RECTANGLE(rect)->origin, ogx, ogy, ogz);
ELL_3V_SET(RECTANGLE(rect)->edge0, e0x, e0y, e0z);
ELL_3V_SET(RECTANGLE(rect)->edge1, e1x, e1y, e1z);
}
return;
}
示例14: dyeColorInit
dyeColor *
dyeColorInit(dyeColor *col) {
if (col) {
ELL_3V_SET(col->val[0], AIR_NAN, AIR_NAN, AIR_NAN);
ELL_3V_SET(col->val[1], AIR_NAN, AIR_NAN, AIR_NAN);
col->xWhite = col->yWhite = AIR_NAN;
col->spc[0] = dyeSpaceUnknown;
col->spc[1] = dyeSpaceUnknown;
col->ii = 0;
}
return col;
}
示例15: echoTriangleSet
void
echoTriangleSet(echoObject *tri,
echoPos_t xx0, echoPos_t yy0, echoPos_t zz0,
echoPos_t xx1, echoPos_t yy1, echoPos_t zz1,
echoPos_t xx2, echoPos_t yy2, echoPos_t zz2) {
if (tri && echoTypeTriangle == tri->type) {
ELL_3V_SET(TRIANGLE(tri)->vert[0], xx0, yy0, zz0);
ELL_3V_SET(TRIANGLE(tri)->vert[1], xx1, yy1, zz1);
ELL_3V_SET(TRIANGLE(tri)->vert[2], xx2, yy2, zz2);
}
return;
}