Results 1 to 5 of 5

Thread: drawing solid of revolution

  1. #1
    Junior Member Newbie
    Join Date
    May 2011
    Location
    Budapest,Hungary,Europe
    Posts
    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. #2
    Senior Member OpenGL Lord
    Join Date
    Mar 2015
    Posts
    6,678

    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. #3
    Senior Member Regular Contributor
    Join Date
    Nov 2010
    Location
    Brazil, Rio de Janeiro
    Posts
    147

    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. #4
    Senior Member OpenGL Lord
    Join Date
    Mar 2015
    Posts
    6,678

    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. #5
    Senior Member Regular Contributor
    Join Date
    Nov 2010
    Location
    Brazil, Rio de Janeiro
    Posts
    147

    Re: drawing solid of revolution

    Quote 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.

Similar Threads

  1. Surface of revolution
    By baconbeastnz in forum OpenGL: General
    Replies: 0
    Last Post: 08-27-2008, 08:09 PM
  2. Solid color not so solid on nVidia??
    By andras in forum OpenGL: Advanced Coding
    Replies: 13
    Last Post: 01-22-2006, 07:27 AM
  3. Drawing a solid cylinder
    By wmspringer in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 04-28-2004, 08:08 AM
  4. solids of revolution?
    By el-ozz in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-29-2002, 07:57 PM
  5. Am I confused... (#Nine Revolution 3d)
    By in forum OpenGL: User Software
    Replies: 0
    Last Post: 07-05-2000, 12:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean