View Full Version : drawing solid of revolution

Jenei Gabor

05-10-2011, 12:05 AM

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.

Alfonse Reinheart

05-10-2011, 12:41 AM

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?

McLeary

05-12-2011, 01:35 PM

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.

Alfonse Reinheart

05-12-2011, 01:57 PM

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.

McLeary

05-12-2011, 03:19 PM

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.

Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.