# Thread: drawing solid of revolution

1. ## drawing solid of revolution

Hello!
So,as I mentioned in the title I need to draw a solid of revolution http://en.wikipedia.org/wiki/Solid_of_revolution in the Descartes coordinate system.But to be more difficult I need to calculate the points of the surface by shader language, so it would be out of OpenGL, just the same Visual Studio Project.Actually as I hardly know anything of OpenGL I would appreciate so much if you could help me.

2. ## Re: drawing solid of revolution

But to be more difficult I need to calculate the points of the surface by shader language, so it would be out of OpenGL, just the same Visual Studio Project.Actually as I hardly know anything of OpenGL I would appreciate so much if you could help me.
So let me get this straight. You need to use OpenGL to compute a surface of revolution. But you "hardly know anything of OpenGL." Why do you need to do it in OpenGL if you know little about OpenGL?

In order to even begin to implement this, you must have a fairly strong knowledge of:

1: How to generate these values on the CPU. That is, how to implement the algorithm.

2: How rendering works in OpenGL.

3: How shaders work in OpenGL.

You also haven't really provided much in the way of details here. How do you define the curves that make up the outline of the surface? Is it a spline? What kind of spline is it? Is it just one cubic spline, or several set end-to-end? Is the axis a fixed direction, or is there a curve defining it as well?

3. ## Re: drawing solid of revolution

Mr. Reinheart tells everything. You need to know how to do the math in CPU before moving it into shaders.

BTW, beyond tesselation, you don't generate the coords with shaders. You can change vertices coords, not generate new ones.

4. ## Re: drawing solid of revolution

BTW, beyond tesselation, you don't generate the coords with shaders. You can change vertices coords, not generate new ones.
Sure you can. You don't have to actually pass positions to your vertex shader; all that matters is that you write positions.

What you can't do in a vertex shader is add new vertices. But a vertex isn't the same thing as a position. A vertex is just a collection of arbitrary data; a position is a point in a space, which may be part of a vertex's data.

5. ## Re: drawing solid of revolution

Originally Posted by Alfonse Reinheart
What you can't do in a vertex shader is add new vertices.
I think I have mistaken the concept of vertex and coordinate. Believing me or not, that's what I meant.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•