Results 1 to 6 of 6

Thread: OpenGL and Builder C++ How to move a model with widgets

  1. #1
    Junior Member Newbie
    Join Date
    May 2003
    Posts
    5

    OpenGL and Builder C++ How to move a model with widgets

    I have created a 3D model of a F-16. I want to have the plane pitch, roll, yaw respectivly when a widget is moved or pressed.

    I have a openGL vcl component that allows me to use OpenGL in the app.

    How can I bring the model into the window?

    How would I go about moving the box.

    thanks,
    sj

  2. #2
    Senior Member Regular Contributor
    Join Date
    Feb 2003
    Location
    Westerville, Oh, USA
    Posts
    201

    Re: OpenGL and Builder C++ How to move a model with widgets

    Try this: store the rotations in some kind of global variables (more on this below). Then code event handlers for the widgets you want to use to control roll, pitch, and yaw. In those handlers, update the global variables so that your rendering code will rotate the plane correctly.

    As far as how you store your rotations, I would suggest looking at a couple articles on rotations:
    http://www.sjbaker.org/steve/omniv/eulers_are_evil.html http://www.sjbaker.org/steve/omniv/m...r_friends.html

    Cheers.

    [This message has been edited by starman (edited 05-15-2003).]

  3. #3
    Junior Member Newbie
    Join Date
    May 2003
    Posts
    5

    Re: OpenGL and Builder C++ How to move a model with widgets

    Very helpful.
    How can I import the rendered 3D model into a matrix one with camera angles and views from all directions?

    I think once I get the model in the scene I will be able to manipulate the movement

    thanks for the help

    sj

  4. #4
    Senior Member Regular Contributor
    Join Date
    Feb 2003
    Location
    Westerville, Oh, USA
    Posts
    201

    Re: OpenGL and Builder C++ How to move a model with widgets

    I think you're confusing your model (the F-16) with the transformations (rotations, translations, etc.). The transformations go in the modelview matrix. The model data that you import can be stored however you like. Typically, you'll draw a scene like this:

    - place "camera" with view transformations (rotate, translate)
    - position model with model transformations (rotate, translate, scale)
    - draw model by sending the model vertices (and textures, etc.) to OpenGL

    I'm relatively new to GL, so I'm sure one of the experts here can answer you better. I'd check out the OpenGL Programming Guide (the red book) chapter 3 on this stuff.

  5. #5
    Junior Member Newbie
    Join Date
    May 2003
    Posts
    5

    Re: OpenGL and Builder C++ How to move a model with widgets

    Reading the "red Book" was very helpful. I was a bit confused about the cameras. I am going to export my model as an ascii file and render it with OpenGL.
    THen I am going to use the gl_modelview() to view from different angles.

    Thanks starman for pointing me in the right direction

    sj

  6. #6
    Junior Member Newbie
    Join Date
    Apr 2003
    Location
    Lancashire, England
    Posts
    18

    Re: OpenGL and Builder C++ How to move a model with widgets

    Johnstonsk - you mentioned a component for BCB & OpenGL?
    Could you post a link to this?
    Cheers,
    doug

Similar Threads

  1. opengl & widgets
    By CarstenT in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 02-02-2019, 06:39 AM
  2. Replies: 0
    Last Post: 01-16-2017, 06:12 AM
  3. use data from opencv to move opengl 3D model
    By neezra in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 11-12-2011, 09:42 PM
  4. OpenGL Widgets?
    By sbayeta in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-26-2005, 10:28 PM
  5. Replies: 4
    Last Post: 05-10-2005, 07:26 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