Results 1 to 4 of 4

Thread: texture in circle

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2001
    Location
    Lisbon
    Posts
    13

    texture in circle

    hi, can anyone tell me if theres a way i can make a circle without making it with lines? and can anyone give me an example on how to texture a sphere?
    thanks

  2. #2
    Senior Member Regular Contributor
    Join Date
    May 2002
    Posts
    189

    Re: texture in circle

    Well you could use bezieh (that is spelled wrong) curves to make a circle and nurbs (I think). There's also some command like glCircle or somethin that will make a circle. The other method is to use sine and cosine and to for loop drawing lines to produce a circle. I have only used the last two methods before. However nomatter what all a circle is once it comes down to it is a bunch of lines (in a non theoretical sense).

    Hope I have shed some light on your situation. In terms of texturing, if you use the last solution texturing would be a piece of cake.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: texture in circle

    Sorry but there is no glCircle command, a circle is a 2D object. But gluDisc makes a flat disk, with or without a hole in the center and you can add a texture to it.

    Easy way for a textured sphere is with the gluSphere and the gluQuadricTexture commands.

    Easy circle: you can make a circle with a paint program and apply it to a quad as a texture.



    Originally posted by JOSE ML:
    hi, can anyone tell me if theres a way i can make a circle without making it with lines? and can anyone give me an example on how to texture a sphere?
    thanks


    [This message has been edited by nexusone (edited 09-03-2002).]

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jan 2002
    Posts
    292

    Re: texture in circle

    Well, the was I texture my sky dome is simply taking one texture and spreding it across the entire sky... I get the coordinates with simple sin cos functions which I use to create my sky dome itself...

    First ask yourself how you make a sphere...
    Then you will see that with the formula of the sphere with radius one you already have a full set of coordinates since a texture coordinates normally range from 0 to 1.
    So after you compute your x,y,z vertices for your sphere, you could get the point of the texture in the sphere with something like:

    m_Texture[0] = x*(radius)*0.5f + 0.5f;
    m_Texture[1] = z*(radius)*0.5f + 0.5f;

    Where the starting point is right at the top of the sphere...

Similar Threads

  1. Replies: 4
    Last Post: 05-31-2016, 05:21 PM
  2. Connect midpoint circle dots for circle outline
    By TalysShade in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 10-05-2012, 03:42 PM
  3. Square Texture over a Circle
    By sunkingac in forum OpenGL ES
    Replies: 1
    Last Post: 01-06-2010, 05:09 PM
  4. Draw Circle, MidPoint Circle Algorithm
    By Trivialnight in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-25-2004, 03:14 PM
  5. Move an texture object around a circle
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-01-2004, 12:52 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