Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Urgent glHelp( )!!

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    17

    Urgent glHelp( )!!

    Hi all,

    I am having trouble with glePolyCylinder.
    glePolyCylinder (n, dpts,dcol,.006);
    I am trying to replace GL_LINES with the poly extrusion to emulate a tool path with a radius of 6 thousandths. Here is were it gets a bit rediculas. I think I have to use a width of 1.0f or height, so that last parameter would have to be at least 1.0f.

    What can be done to scale graphics with OpenGL to some real size...so that it is at least proportional?

    Help please

    SpaceGhost

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: Urgent glHelp( )!!

    Never used the gle stuff, but scale is all about how you define it. There's nothing that says you need to have polys that are greater than 1. You could for instance, set an orhtographic projection where the left plane is -0.1, and the right plane is 0.1, and then draw a line from -0.004 to 0.004.

    Obviously, as you use smaller numbers like this, you are more likely to run into rounding errors in floating point numbers, though. It might be better to multiply everything by 100, or some other multiple of 10.
    Deiussum
    Software Engineer and OpenGL enthusiast

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    17

    Re: Urgent glHelp( )!!

    Is there a polyline command, or something that is not part of gle32 that I do not know about? I just need some sort command I can use to generate a cylindrical path.

    Thanks SG

  4. #4
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    17

    Re: Urgent glHelp( )!!

    And thanks for your reply D.
    -SG

  5. #5
    Senior Member Frequent Contributor
    Join Date
    Jan 2003
    Location
    Virginia
    Posts
    586

    Re: Urgent glHelp( )!!

    GL_LINE_STRIP or GL_LINE_LOOP

  6. #6
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    17

    Re: Urgent glHelp( )!!

    Originally posted by shinpaughp:
    GL_LINE_STRIP or GL_LINE_LOOP
    Ok, great!
    ..and how do you suggest I show a line width of .006? would glLineWidth(.006)work?

    Thanks Shin,
    -SG

  7. #7
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: Urgent glHelp( )!!

    Scale up by a thousand! so you have line width of 6

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

    Re: Urgent glHelp( )!!

    First openGL size should be treated as relative size and scale.

    If this is for a CAD program, you convert you exact measurements to relative for drawing to the screen.

    X line maybe 0.006 thick, but since your monitor's resolution will not let you draw a line that size you just draw the line relative to other lines.

    So a 0.006 maybe 6 gl units in width and a 0.010 would be 10 gl units to show diffrence in size.

    You just store in a seperate variable what each line real value is, when the user draws the line on the screen.

    data example:

    line // What we are drawing.
    X1,Y1,Z1 //Starting point of line in real terms
    X2,Y2,Z2 // Ending point of line in real terms.
    0.006 // Real width of line.

    Note when displaying the line, screen size will very based on zoom and scaling, but not the real size.

    Hope this helps.


    Originally posted by SpaceGhost:
    Ok, great!
    ..and how do you suggest I show a line width of .006? would glLineWidth(.006)work?

    Thanks Shin,
    -SG

  9. #9
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    17

    Re: Urgent glHelp( )!!

    Sounds correct nexusone, thanks for your reply.

    I had thought I might do a thing like that, but I guess what threw me was that I could use units like .001 when assigning vertices and other glXXX3d() functions.

    glEnable(GL_LINE_SMOOTH) was supposed to allow for a Line Width less than 1.0f, but when I tried the width, it seemed to fail.

    SpaceGhost

  10. #10
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: Urgent glHelp( )!!

    I think glLineWidth sets the width of the line in pixels, not in the virtual coordinates of the scene.
    Deiussum
    Software Engineer and OpenGL enthusiast

Page 1 of 2 12 LastLast

Similar Threads

  1. Help me pls...very urgent...thanks very much...
    By scorpio79 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-07-2005, 07:58 PM
  2. URGENT, Help
    By alvin in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-23-2003, 08:12 PM
  3. URGENT, Help
    By alvin in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-23-2003, 12:56 AM
  4. URGENT, Help
    By alvin in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 01-22-2003, 06:32 PM
  5. Urgent!!
    By link19 in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 07-27-2001, 04:04 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