Results 1 to 2 of 2

Thread: drawing geometric objects---2

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2009
    Posts
    2

    drawing geometric objects---2

    Can a rectangle/square be drawn from just knowing end coordinates of one of its diagonals? If yes, how? Also could someone post a link/something that I has good examples of opengl programming in java?

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: drawing geometric objects---2

    yes.

    imagine the 4 corners are ABCD. you know point A and C (diagonal).
    so B is :
    B.x = A.x
    B.y = C.y

    and D is :
    B.x = C.x
    B.y = A.y

    Try first with GL_LINES.


    opengl+java :
    https://jogl-demos.dev.java.net/
    https://jogl-demos.dev.java.net/sour...se/jogl-demos/

Similar Threads

  1. drawing two objects with two vbo,vao
    By eniddelemaj in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-02-2017, 12:24 PM
  2. drawing geometric objects
    By lilian in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-24-2009, 01:58 PM
  3. Drawing objects
    By imported_Ulrich in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-21-2004, 01:43 PM
  4. Replies: 0
    Last Post: 12-14-2002, 07:45 PM
  5. Geometric Objects
    By Hec in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 02-22-2000, 06:48 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