Results 1 to 2 of 2

Thread: How to draw a quardratic surface?

  1. #1
    Newbie Newbie
    Join Date
    Apr 2014
    Posts
    1

    Question How to draw a quardratic surface?

    For example, I have a surface defined like: z = ax^2 + bxy + cy^2.
    How can I draw it using openGL?
    Thanks a lot.

  2. #2
    Senior Member Regular Contributor Agent D's Avatar
    Join Date
    Sep 2011
    Location
    Innsbruck, Austria
    Posts
    281
    Lagacy or core only? AFAIK legacy OpenGL(R) has functions for drawing quadrics. (I have never used them myself)

    Personally, I would stick to core profile OpenGL(R), create a vertex buffer by subdividing a square (e.g. 10*10 sub patches -> 200 triangles -> 100 vertices + 600 indices. Can be easily generated in a for loop). For each vertex, map the 2D coordinates on the square surface to the range you are interested in and compute the resulting third coordinate.

    The resulting vbo/ibo combination can be rendered like any other object.

Similar Threads

  1. How to draw implicit surface?
    By booncw in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 11-18-2009, 08:00 AM
  2. draw ellipses on a surface
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-10-2004, 02:40 AM
  3. How can I draw a line on a surface?
    By Aquileo in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 12-19-2003, 06:54 AM
  4. how to draw surface with axis
    By porsgl in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 03-18-2002, 09:13 PM
  5. How can I draw the surface to only Z-buffer?
    By ANGEL in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-02-2000, 01:00 PM

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