Re: Perl/OpenGL to embed frame
野村 <[email protected]> Mon, 23 Oct 2006 14:02:16 +0900
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <[email protected]> |
Hello ptk.
I tried zinc but couldn't get what I want. I tried 'curve' like this.
This takes time till the end of drawing.
--------------------------------------
my $mw = MainWindow->new();
my $zinc = $mw->Scrolled('Zinc', -width => 700, -height => 600,
-font => '10x20', -borderwidth => 3,
-relief => 'sunken', -scrollbars => 'se',
-scrollregion => [1, -100, 1024 , 100]);
my @tmp;
for( my $i=0; $i < 10000; $i++) {
push @tmp, $i;
push @tmp, sin($i) * 8 ;
}
$zinc->add('curve', 1, \@tmp,
-filled => 0, -relief => 'roundgroove',
);
$zinc->pack(-expand => 'yes', -fill => 'both');
MainLoop;
---------------------------------------
On the other hand Perl/OpenGL will draw the lines with much less time
and it goes like this.
---------------------------------------
sub display {
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_LINE_STRIP);
for(my $i=0; $i<10000;$i++){
glVertex2f($i, sin($i) * 8);
}
glEnd();
}
---------------------------------------
if we use glList, we can store drawn lines into glList and we can blit
them into display. Zinc's demo is great but it seems zinc is not for
fast drawing...
I am now trying to compile, and to check source codes of Perl/OpenGL.
Or am I missing some feature in zinc ?
Or is there any better way ?
regards,
daiki nomura.
>
>I sent e-mail to Perl/OpenGL autor, but couldn't get any response.
>
>When I tried Tk Zinc, it's drawing lines (method 'curve' ) are mostly
>same speed as Canvas widget. But I didn't check whole capability of zinc,
>I try Zinc again. Zinc has msi installer for Active Perl.
>
>Any suggestion will be appreciated.
>thanks.
>
>>
>>> Hello ptk.
>>>
>>> I found Perl/OpenGL is nice for my drawing 20-40 thousands of lines at a
>>> time. And I want them embeded into Tk::Frame. On FreeBSD, glpOpenWindow
>>> works, but on Win32/ActivePerl it doesn't work as Perl/OpenGL author
>>> says(http://www.bribes.org/perl/wopengl.html) .
>>
>>Did you contact the author directly?
>>
>>> What I expect for OpenGL is two things. One is List's graphic context
>>> capability and anothor is Double Buffering. In a word, draw lines fast.
>>>
>>> I am lost for several months for this, and appreciate any suggestions.
>>>
>>
>>I am not sure about the performance of Tk::Zinc, but I know it uses
>>OpenGL if possible under the hood. I also don't know what's the status
>>of Tk::Zinc under Windows.
>>
>>Regards,
>> Slaven
>>
>>--
>>Slaven Rezic - slaven <at> rezic <dot> de
>>
>> tkrevdiff - graphical display of diffs between revisions (RCS, CVS or
>>SVN)
>> http://ptktools.sourceforge.net/#tkrevdiff
>>__________ NOD32 1.1810 (20061018) 情報 __________
>>
>>このメールはNOD32によって検査済みです。
>>http://canon-sol.jp
--++**==--++**==--++**==--++**==--++**==--++**==--++**==
ptk mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/ptk