- Timestamp:
- 11/27/05 16:32:57 (7 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgdelaunay/osgdelaunay.cpp
r4845 r4847 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield 2 2 * 3 3 * This application is open source and may be redistributed and/or modified … … 140 140 141 141 class LinearConstraint: public osgUtil::DelaunayConstraint { 142 /** forces edges of a " Images/road" to fit triangles142 /** forces edges of a "road" to fit triangles 143 143 * if 2 roads cross, then the overlap will be replaced by a 'cross road' 144 144 * and the roads built up to the cross roads with a texture along its length. */ … … 266 266 int j=np%maxp; 267 267 // make the random scale 0.00 if you want an equispaced XY grid. 268 float x=3000.0/(maxp-1)*i+ 0.00052*rand();269 float y=3000.0/(maxp-1)*j+ 0.0005*rand();268 float x=3000.0/(maxp-1)*i+16.*(float)rand()/RAND_MAX; 269 float y=3000.0/(maxp-1)*j+16.*(float)rand()/RAND_MAX; 270 270 float z=getheight(x,y); 271 271 if (np>=maxp*maxp) z=-1.e32; … … 381 381 osg::ref_ptr<osgUtil::DelaunayConstraint> dc; 382 382 std::ostringstream what; 383 if (1== 1) { // add a simple constraint of few points383 if (1==0) { // add a simple constraint of few points 384 384 osg::ref_ptr<osgUtil::DelaunayConstraint> dc=new osgUtil::DelaunayConstraint; 385 385 osg::Vec3Array *bounds=new osg::Vec3Array; … … 639 639 geode->addDrawable(dc2->makeAreal(arpts.get())); // this creates fill in geometry 640 640 641 if (ndcs>4) { // a simple " Images/road"641 if (ndcs>4) { // a simple "road" 642 642 trig->removeInternalTriangles(dc3.get()); 643 643 dc3->setTexture ("Images/road.png"); … … 1126 1126 } 1127 1127 1128 osg::Vec3Array *LinearConstraint::getRoadNormals(const osg::Vec3Array *) const1128 osg::Vec3Array *LinearConstraint::getRoadNormals(const osg::Vec3Array *points) const 1129 1129 { 1130 1130 osg::Vec3Array *nrms=new osg::Vec3Array;
