当前位置: 首页>>代码示例>>PHP>>正文


PHP Render::renderSegment方法代码示例

本文整理汇总了PHP中Render::renderSegment方法的典型用法代码示例。如果您正苦于以下问题:PHP Render::renderSegment方法的具体用法?PHP Render::renderSegment怎么用?PHP Render::renderSegment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Render的用法示例。


在下文中一共展示了Render::renderSegment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Vertex

    $h = new Vertex(array('x' => $x - $hl, 'y' => $y - $hl, 'z' => $z - $hl, 'color' => $white));
    return array(new Triangle($a, $c, $b), new Triangle($a, $d, $c), new Triangle($e, $g, $h), new Triangle($e, $f, $g), new Triangle($e, $b, $f), new Triangle($a, $b, $e), new Triangle($d, $g, $c), new Triangle($d, $h, $g), new Triangle($a, $e, $h), new Triangle($a, $h, $d), new Triangle($f, $c, $g), new Triangle($f, $b, $c));
}
$v = new Vector(array('dest' => new Vertex(array('x' => 20.0, 'y' => 20.0, 'z' => 0.0))));
$T = new Matrix(array('preset' => Matrix::TRANSLATION, 'vtc' => $v));
$S = new Matrix(array('preset' => Matrix::SCALE, 'scale' => 10.0));
$RY = new Matrix(array('preset' => Matrix::RY, 'angle' => M_PI_4));
$RX = new Matrix(array('preset' => Matrix::RX, 'angle' => M_PI_4));
$cam = new Camera(array('origin' => new Vertex(array('x' => 15.0, 'y' => 15.0, 'z' => 80.0)), 'orientation' => new Matrix(array('preset' => Matrix::RY, 'angle' => M_PI)), 'width' => 640, 'height' => 480, 'fov' => 60, 'near' => 1.0, 'far' => 100.0));
$renderer = new Render(array('width' => 640, 'height' => 480, 'filename' => 'pic.png'));
echo "test";
$origin = new Vertex(array('x' => 50.0, 'y' => 50.0, 'z' => 50.0));
$origin = $cam->watchVertex($origin);
$vtx = new Vertex(array('x' => 20.0, 'y' => 20.0, 'z' => 0.0));
$vtc = new Vertex(array('x' => -20.0, 'y' => -20.0, 'z' => 0.0));
$renderer->renderSegment($vtx, $origin);
$vtt = new Vertex(array('x' => 30.0, 'y' => 60.0, 'z' => 20.0));
$renderer->renderSegment($vtt, $vtx);
$renderer->renderSegment($vtt, $origin);
/*
$repere = makeRepere();

$repere = $S->transformMesh( $repere );
$repere = $cam->watchMesh( $repere );
$renderer->renderMesh( $repere, Render::EDGE );
*/
$renderer->renderVertex($origin);
/*
$cube = makeColoredCube( 0.0, 0.0, 0.0, 1.0 );
$M = $T->mult( $RX )->mult( $RY )->mult( $S );
$cube = $M->transformMesh( $cube );
开发者ID:arioch31,项目名称:anarstock,代码行数:31,代码来源:main_05.php


注:本文中的Render::renderSegment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。