Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Hint about 3D path

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

    Hint about 3D path

    Hello,
    I'm quite new to OpenGL. I'm studying the docs and playing with examples.
    I'd like to ask you some hints to put me on the right way.

    The goal is to draw a 3D path. It will look like a PCB milling toolpath (I can't insert an example url due to forum policy).


    My questions:

    1) should I draw lines or cylinders?

    2) I will provide a "zoom" feature. In fact I want to change the viewed area, not the rendered dimensions of the items. I mean: let's say my lines at default distance are 3 pixel width. When the zoom changes I would like the lines are still rendered with a width of 3 pixels.

    3) I also have a pan feature. In this case I want the object follows the mouse pointer regardless the actual distance. The only (cumbersome) way I found is to calculate the delta at a given distance as the item is at the default, but it is difficult and not accurate. Is there any trick using matrix and transformations?

    Thanks in advance!
    Mark

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,106
    should I draw lines or cylinders?

    If you plan to fly around the board you will probably better using cylinders.

    there are lots of examples on the web of panning and zooming. Panning can be tricky if you wish to grab an item in 3D. You will need support info to convert a screen xy to an object. This is a good example of panning

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •