0

Issue involves:
python 2.7
pil
pyopengl
pyside


In the midst of developing a small drawing test, I've run into a situation involving line computations.

Currently the drawing test works, but only enables singular point drawing at the cursor position.

[IMG]http://i246.photobucket.com/albums/gg94/Braschko/Forum%20Posts/Screenshot-1.png[/IMG]


I've seen python interpretations of Bresenham's line algorithm, which works as expected.
However, with loop overhead, the calculations become slow... revealing a slowly generating line of sorts.

Threading might be an answer, my understanding is limited though.

The question being, what would be a better method to allow for faster line drawing in this situation?

My thoughts are to reduce the number of glUpdate calls... still testing.


*source available, feel free to use*

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by raschko
0

To my mind comes at least using numpy for generating the point list. Numpy was missing from your list.

0

To my mind comes at least using numpy for generating the point list. Numpy was missing from your list.

I will look into that. *thumbs up*


In the mean time, things are being changed to see if I can limit the number of refresh rates to GL.. or at least some sort of frame dropping mechanism.
*will post later*

0

I've been looking through google and numpy documentation, which has confused memor than anything.

My understanding so far to create the points between two cursor positions is:

import numpy as np

x,y,x2,y2 = 0,0,10,10
xVec = np.arange(x,x2)
yVec = np.arange(y,y2)

points = xVec+yVec

This only work in the respect of both x and y distances being equal..
*scratches head*

Edited by raschko: typo

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.