go to www.geomview.org home page
 
Home

Overview
FAQ
Documentation

Download

Mailing List

Geomview For Windows?

Support
Users
Development

Bug Reporting
Contributing
Contact Us

Sponsors

 

Site Search

 

Advanced
Search

 
About the software@geom archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Update REQ 5511]: Cylinders


  • To: software@geom
  • Subject: Re: [Update REQ 5511]: Cylinders
  • From: "Stuart Levy" <slevy>
  • Date: Tue, 1 Aug 1995 10:01:22 -0500

Yes.  For example, here's a simple "awk" script to generate an OOGL cylinder.

Note that it uses a u-wrapped mesh, i.e. the last vertex in each row
is implicitly connected to the first vertex in the same row.
It would still produce a cylinder if it were changed to produce a plain MESH
and if the (u/nu) were changed to (u/(nu-1)) so that the last vertex of
each row were duplicated.  However, then the cylinder would show a seam
at that point when smooth-shaded: the computation of surface normals depends
on having the surface be unbroken.

#! /bin/sh

nawk '
   BEGIN {
	nu = 40;
	nv = 2;

	print "uMESH";
	print nu, nv;

	for(v = 0; v < nv; v++) {
	    z = 2*v/(nv-1) - 1;
	    for(u = 0; u < nu; u++) {
		t = 2*3.14159*u/nu;
		x = cos(t);
		y = sin(t);
		print x, y, z;
	    }
	}
	exit;
    }'


 
Home | Overview | FAQ | Documentation | Support | Download | Mailing List
Windows? | Development | Bug Reporting | Contributing | Contact Us | Sponsors
 
site hosted by
SourceForge Logo