Esempio n. 1
0
	GLuint Positions(std::vector<T>& dest) const
	{
		dest.resize(20*3*3);

		const GLdouble* p = _positions();
		const GLushort* i = _indices();

		for(GLuint f=0; f!=20; ++f)
		{
			for(GLuint v=0; v!=3; ++v)
			{
				for(GLuint c=0; c!=3; ++c)
				{
					dest[f*9+v*3+c] = p[i[f*3+v]*3+c];
				}
			}
		}
		return 3;
	}
Esempio n. 2
0
	GLuint Normals(std::vector<T>& dest) const
	{
		dest.resize(20*3*3);

		const GLdouble* p = _positions();
		const GLushort* i = _indices();

		for(GLuint f=0; f!=20; ++f)
		{
			Vector<T, 3> v0(p+i[f*3+0]*3, 3);
			Vector<T, 3> v1(p+i[f*3+1]*3, 3);
			Vector<T, 3> v2(p+i[f*3+2]*3, 3);
			Vector<T, 3> fn(Normalized(Cross(v1-v0, v2-v0)));

			for(GLuint v=0; v!=3; ++v)
			{
				for(GLuint c=0; c!=3; ++c)
				{
					dest[f*9+v*3+c] = fn[c];
				}
			}
		}
		return 3;
	}
Esempio n. 3
0
	/// Returns element indices that are used with the drawing instructions
	IndexArray Indices(void) const
	{
		const GLushort* i = _indices();
		return IndexArray(i, i+20*3);
	}
Esempio n. 4
0
	/// Returns element indices that are used with the drawing instructions
	IndexArray Indices(Default = Default()) const
	{
		const GLushort* i = _indices();
		return IndexArray(i, i+20*3);
	}