diff options
| author | Stijn Buys <ingar@osirion.org> | 2008-03-22 23:22:38 +0000 | 
|---|---|---|
| committer | Stijn Buys <ingar@osirion.org> | 2008-03-22 23:22:38 +0000 | 
| commit | 8485d43feca5597c4b412c6912aadcd9586e3cde (patch) | |
| tree | 76727ff76ee64ca9976b590578c4e6a641c5208f | |
| parent | 7fef8856b21215b0dd28dcc57f04c8a98ab5226f (diff) | |
display vertex array usage
fixed sphere orientation
| -rw-r--r-- | src/core/model.cc | 2 | ||||
| -rw-r--r-- | src/render/sphere.cc | 11 | 
2 files changed, 6 insertions, 7 deletions
| diff --git a/src/core/model.cc b/src/core/model.cc index df6e563..686cbfd 100644 --- a/src/core/model.cc +++ b/src/core/model.cc @@ -628,5 +628,7 @@ void Model::list()  			<< (*mit).second->model_light.size() << " lights\n";  	}  	con_print << registry.size() << " registered models" << std::endl; +	con_print << "vertex/evertex array usage " << (VertexArray::vertex_index * 100) / VERTEXARRAYSIZE << "%/" << +		(VertexArray::evertex_index * 100) / VERTEXARRAYSIZE << "%\n";  }  } diff --git a/src/render/sphere.cc b/src/render/sphere.cc index 4a94acd..d44c9e6 100644 --- a/src/render/sphere.cc +++ b/src/render/sphere.cc @@ -97,33 +97,30 @@ void Sphere::draw()  		} else {  			gl::begin(gl::QuadStrip);  		}		 -		v = Vector3f(r, radius*costable[j], 0); +		v = Vector3f(r, 0, radius*costable[j]);  		n = v;  		n.normalize();  		normal(n);  		vertex(v); -		v = Vector3f(r1, radius*costable[j+1], 0); +		v = Vector3f(r1, 0, radius*costable[j+1]);  		n = v;  		n.normalize();  		normal(n);  		vertex(v);  		for (int i = segments-1; i >= 0; i--) { -			v = Vector3f(r*costable[i], radius*costable[j], r*sintable[i]); +			v = Vector3f(r*costable[i], r*sintable[i], radius*costable[j]);  			n = v;  			n.normalize();  			normal(n);  			vertex(v); -			v = Vector3f(r1*costable[i], radius*costable[j+1], r1*sintable[i]); +			v = Vector3f(r1*costable[i], r1*sintable[i], radius*costable[j+1]);  			n = v;  			n.normalize();  			normal(n);  			vertex(v); - -			//vertex(r*costable[i-1], radius*costable[j], r*sintable[i-1]); -			//vertex(r1*costable[i-1], radius*costable[j+1], r1*sintable[i-1]);  		}  		end(); | 
