Hi Grigory,

Could you explain what you mean by "Crystal Lattice".  Knowing what you are
actually trying to achieve help others guide you in the right direction.

Robert.

On 14 April 2015 at 07:38, Grigory Krivyakin <[email protected]> wrote:

> Hello
>
> I try to create a simple crystal lattice and dont know how make it better.
> I create a original geode cell and use matrix translations:
>
>
> Code:
>
> osg::ref_ptr<osg::Group> root = new osg::Group;
> osg::ref_ptr<osg::Geode> cell = Cell();
>
> osg::ref_ptr<osg::MatrixTransform> transform = new osg::MatrixTransform;
> transform->addChild(cell);
> root->addChild(transform);
>
> for(int i = 0; i < 10; i++) {
>   for(int j=0; j < 10; j++) {
>     for(int k=0; k < 2; k++) {
>       osg::ref_ptr<osg::MatrixTransform> transform = new
> osg::MatrixTransform;
>       transform->setMatrix(osg::Matrix::translate(i*4.0f, j*4.0f, k*4.0f));
>       transform->addChild(cell);
>       root->addChild(transform);
>     }
>   }
> }
>
>
>
>
> this code creates the crystal lattice with 10 periods along axis X and Y,
> and 2 periods along Z, but i think it is bad way, can some one give me some
> advice, how make it right?
>
>
> Sorry for my english. Thank you!
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=63376#63376
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to