Another thread on Oplot...and handle graphics.

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Another thread on Oplot...and handle graphics.

Ole Jacob Hagen-3
Hi, Octaver's.

I've created a milestone1.m for Oplot, to show how far(/short) I have
reached in Oplot-development.

Besides octplot there are no visualisation applications that can run
this script.

Please check out the script, by using Matlab or Oplot to see the results.

Which plotting routines are most commonly used by you? Please let me
know, maybe I will give it higher priority.
Or maybe you can send me the m-script, if its possible.

Refinement of appearance, and adding new object such as Patch, Surface
is being developed as fast as possible. However, skeleton-implementation
for Surface has already been implemented.

Cheers,

Ole J.

%% Test file for Props and Oplot


%%%%%%%%% first we define some data to play with %%%%%

t = 0:0.2:30;
y1 = 3*sin(6*t);
y2 = cos(12*t) + 2;

X1 = y1'*y2;

fidx =1;
axax(1,:) = [-1 35 -4 6];
axax(2,:) = [0 1 0 1];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% simple plot command  %%%%%%%
figure(fidx)
clf
plot(t,y1)
xlabel('Here is an x label');
ylabel('Here is an y label');
axis(axax(1,:))
title('Yo, this is nice plot!')
fidx = fidx + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% simple plot command with different
% markers
figure(fidx)
clf
plot(t,y1,'ok')
hold on
plot(t,y1,'+r')
plot(t,y1+2,'*g')
xlabel('Here is an x label');
ylabel('Here is an y label');
axis(axax(1,:))
title('Yo, this is ANOTHER nice plot!')
fidx = fidx + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% simple plot command with different
% markers of different size
figure(fidx)
clf
h1 = plot(t,y1,'ok')
hold on
h2 = plot(t,y1,'+r')
h3 = plot(t,y1+2,'*g')

set(h1,'markersize',10)
set(h2,'markersize',20)
set(h3,'markersize',30)

xlabel('Here is an x label');
ylabel('Here is an y label');
axis(axax(1,:))
title('Plot with different marker sizes')
fidx = fidx + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% simple plot command where we change the
% line size
figure(fidx)
clf
h1 = plot(t,y1)
set(h1,'linewidth',4);
xlabel('Here is an x label');
ylabel('Here is an y label');
axis(axax(1,:))
title('Changing line width')
fidx = fidx + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% plot command where we change the
% line size, insert text, draw a line
figure(fidx)
disp('jeg er vel her, tror jeg');
printf('figure nummer = %f\n', fidx);
clf
U = rand(10,3);
[n,m]=size(U);
h1 = plot(U(:,1)',U(:,2)','.k')
hold on
set(h1,'markersize',10);
for i = 1:n
  str = ['Point no. ' int2str(i)];
  text(U(i,1),U(i,2),str);
end;
% adding a line

g0 = line([0 1],[0 1])
set(g0,'linewidth',4,'color',[1 0 1]);

g1=xlabel('Here is an x label');
g2=ylabel('Here is an y label');

set(g1,'fontsize',20);
set(g2,'fontsize',20);

axis(axax(2,:))
g3=title('Shouting is fun!')

set(g3,'fontsize',25,'color',[1 0 0],'fontname','courier','FontWeight','bold');
fidx = fidx + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Her er milestone filen for image plottingen:

% Here is some example use of image commands

[r,g,b] = imread('testimage.jpg');
X(:,:,1) = r;
X(:,:,2) = g;
X(:,:,3) = b;


fidx = fidx+1;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%  simple image plot  %%%%%%%
figure(fidx)
clf

image(X)
hold on

xx = round(300*rand(1,50));
yy = round(300*rand(1,50));
h = plot(xx,yy,'.k');
set(h,'markersize',45,'color',[0 0 1]);

xlabel('Here is an x label');
ylabel('Here is an y label');
title('Simple image plot')
fidx = fidx + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%  image with suplot plot  %%%%%%%
hold off;
figure(fidx)
clf

subplot(2,2,1);
image(X)

title('No.1');

subplot(2,2,2);
image(X)
hold on
xx = round(300*rand(1,50));
yy = round(300*rand(1,50));
h = plot(xx,yy,'.k');
set(h,'markersize',25,'color',[1 1 1]);
title('No.2');

subplot(2,2,3);
image(X)
hold on
xx = round(300*rand(1,50));
yy = round(300*rand(1,50));
h = plot(xx,yy,'.k');
set(h,'markersize',25,'color',[1 0 1]);
title('No.3');

subplot(2,2,4);
image(X)
hold on
xx = round(300*rand(1,50));
yy = round(300*rand(1,50));
h = plot(xx,yy,'.k');
set(h,'markersize',25,'color',[0 0 0]);

title('No.4');
xlabel('Here is an x label');
ylabel('Here is an y label');
title('Image plot with more stuff','fontsize',14,'color','g')
fidx = fidx + 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Reply | Threaded
Open this post in threaded view
|

Re: Another thread on Oplot...and handle graphics.

Stéfan van der Walt
Hi Ole

Where can the latest version and screenshots of oplot be found?

Regards
Stéfan

On Tue, Jul 19, 2005 at 10:15:30AM +0000, Ole Jacob Hagen wrote:
> Hi, Octaver's.
>
> I've created a milestone1.m for Oplot, to show how far(/short) I have
> reached in Oplot-development.
>
> Besides octplot there are no visualisation applications that can run
> this script.
>
> Please check out the script, by using Matlab or Oplot to see the results.

Reply | Threaded
Open this post in threaded view
|

Re: Another thread on Oplot...and handle graphics.

Shai Ayal-2
Ole,

I think that you should make an offcial release so that we can all try oplot++.

Shai

On 7/19/05, Stefan van der Walt <[hidden email]> wrote:

> Hi Ole
>
> Where can the latest version and screenshots of oplot be found?
>
> Regards
> Stéfan
>
> On Tue, Jul 19, 2005 at 10:15:30AM +0000, Ole Jacob Hagen wrote:
> > Hi, Octaver's.
> >
> > I've created a milestone1.m for Oplot, to show how far(/short) I have
> > reached in Oplot-development.
> >
> > Besides octplot there are no visualisation applications that can run
> > this script.
> >
> > Please check out the script, by using Matlab or Oplot to see the results.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Another thread on Oplot...and handle graphics.

Ole Jacob Hagen-3
Hi,

I will make a 0.1 release in a couple of days now.

Oplot can also be downloaded by using CVS.
Oplot webpage is located at http://oplot.sf.net and
http://sourceforge.net/projects/oplot.

If you can't wait until I make an official release, then you can
download from CVS.
Read the instructions on how to download the source from cvs at
http://sourceforge.net/cvs/?group_id=73257

Remember that the CVS-version is compilable, but not always functional.

I will announce the 0.1 release here at maintainer list.


Cheers,

Ole J.


Reply | Threaded
Open this post in threaded view
|

Re: Another thread on Oplot...and handle graphics.

Ole Jacob Hagen-3
In reply to this post by Ole Jacob Hagen-3

Since Oplot is using Coin3D as visualisation library, Oplot can use two
methods to generate postscript files.

Method 1:

OffscreenRenderer generates texture maps of on the fly  as bitmaps or
postscript.
 
Offscreen rendering is internally done through either a GLX offscreen
context (i.e. OpenGL on X11) or a WGL (i.e. OpenGL on Win32) or AGL
(i.e. OpenGL on the Mac OS) ditto. If the OpenGL driver supports the
pbuffer extension, it is detected and used to provide
hardware-accelerated offscreen rendering.

One particular usage of the SoOffscreenRenderer is to make it render
frames to be used for the construction of movies. The general technique
for doing this is to iterate over the following actions:

    * move camera to correct position for frame
    * update the |realTime| global field (see explanation below)
    * invoke the SoOffscreenRenderer
    * dump rendered scene to file

..then you use some external tool or library to construct the movie
file, for instance in MPEG format, from the set of files dumped to disk
from the iterative process above.

Method 2:

SoVectorizeAction is the base class for vectorization of Coin scene graphs.

Currently supported geometry:

    * Triangles (polygons will be tessellated)
    * Line segments
    * Points (can be drawn as circles or squares)
    * 2D text
    * 3D text
    * Images

Texturemaps are not supported.

SoOffscreenRenderer and SoHardCopy is included in the Coin3D library.

Oplot is using SoOffscreenRenderer as default today, but a dialog-based
printing dialog where a user can choose what method to choose from is
under development. ;-)

Cheers,

Ole J.




Shai Ayal wrote:

>Ole,
>
>One of the most importand features, IMHO, is hardcopy. Do you support
>"prinitng" to some vector file format (e.g. ps/pdf/fig) ? If not this
>should certainly be on your high priority list. Note: It is important
>that you support some vector format which is resolution independant so
>that real hardcopy on a printer/published paper will look acceptable.
>Bitmap formats are nice (and might be easier to implement) but are
>good for screen display at most.
>
>Shai
>
>  
>

Reply | Threaded
Open this post in threaded view
|

Re: Another thread on Oplot...and handle graphics.

Shai Ayal-2
So you have both bitmap & vector hardcopy. This is excellent.

I would recommend implementing the "print" command as in matlab/octave
before spending time on a nice dialogue box.

Shai

On 7/20/05, Ole Jacob Hagen <[hidden email]> wrote:

>
> Since Oplot is using Coin3D as visualisation library, Oplot can use two
> methods to generate postscript files.
>
> Method 1:
>
> OffscreenRenderer generates texture maps of on the fly  as bitmaps or
> postscript.
>
> Offscreen rendering is internally done through either a GLX offscreen
> context (i.e. OpenGL on X11) or a WGL (i.e. OpenGL on Win32) or AGL
> (i.e. OpenGL on the Mac OS) ditto. If the OpenGL driver supports the
> pbuffer extension, it is detected and used to provide
> hardware-accelerated offscreen rendering.
>
> One particular usage of the SoOffscreenRenderer is to make it render
> frames to be used for the construction of movies. The general technique
> for doing this is to iterate over the following actions:
>
>     * move camera to correct position for frame
>     * update the |realTime| global field (see explanation below)
>     * invoke the SoOffscreenRenderer
>     * dump rendered scene to file
>
> ..then you use some external tool or library to construct the movie
> file, for instance in MPEG format, from the set of files dumped to disk
> from the iterative process above.
>
> Method 2:
>
> SoVectorizeAction is the base class for vectorization of Coin scene graphs.
>
> Currently supported geometry:
>
>     * Triangles (polygons will be tessellated)
>     * Line segments
>     * Points (can be drawn as circles or squares)
>     * 2D text
>     * 3D text
>     * Images
>
> Texturemaps are not supported.
>
> SoOffscreenRenderer and SoHardCopy is included in the Coin3D library.
>
> Oplot is using SoOffscreenRenderer as default today, but a dialog-based
> printing dialog where a user can choose what method to choose from is
> under development. ;-)
>
> Cheers,
>
> Ole J.
>
>
>
>
> Shai Ayal wrote:
>
> >Ole,
> >
> >One of the most importand features, IMHO, is hardcopy. Do you support
> >"prinitng" to some vector file format (e.g. ps/pdf/fig) ? If not this
> >should certainly be on your high priority list. Note: It is important
> >that you support some vector format which is resolution independant so
> >that real hardcopy on a printer/published paper will look acceptable.
> >Bitmap formats are nice (and might be easier to implement) but are
> >good for screen display at most.
> >
> >Shai
> >
> >
> >
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Another thread on Oplot...and handle graphics.

Stéfan van der Walt
In reply to this post by Ole Jacob Hagen-3
On Wed, Jul 20, 2005 at 08:43:34AM +0000, Ole Jacob Hagen wrote:

>
> One particular usage of the SoOffscreenRenderer is to make it render
> frames to be used for the construction of movies. The general technique
> for doing this is to iterate over the following actions:
>
>    * move camera to correct position for frame
>    * update the |realTime| global field (see explanation below)
>    * invoke the SoOffscreenRenderer
>    * dump rendered scene to file
>
> ..then you use some external tool or library to construct the movie
> file, for instance in MPEG format, from the set of files dumped to disk
> from the iterative process above.

It is not even necessary to use an external tool.  The FFMpeg wrapping
class at

http://www.dsp.sun.ac.za/~stefan

allows you to generate movies from within Octave.

Regards
Stéfan

Reply | Threaded
Open this post in threaded view
|

Re: Another thread on Oplot...and handle graphics.

Ole Jacob Hagen-3
Stefan van der Walt wrote:

>On Wed, Jul 20, 2005 at 08:43:34AM +0000, Ole Jacob Hagen wrote:
>  
>
>>One particular usage of the SoOffscreenRenderer is to make it render
>>frames to be used for the construction of movies. The general technique
>>for doing this is to iterate over the following actions:
>>
>>   * move camera to correct position for frame
>>   * update the |realTime| global field (see explanation below)
>>   * invoke the SoOffscreenRenderer
>>   * dump rendered scene to file
>>
>>..then you use some external tool or library to construct the movie
>>file, for instance in MPEG format, from the set of files dumped to disk
>>from the iterative process above.
>>    
>>
>
>It is not even necessary to use an external tool.  The FFMpeg wrapping
>class at
>
>http://www.dsp.sun.ac.za/~stefan
>
>allows you to generate movies from within Octave.
>
>Regards
>Stéfan
>
>  
>
Ok, this feature is included in Coin3D, which is the c++ opengl library
I am using.
Read more about Coin here: http://coin3d.org
Thanks for the link, Stefan.

Cheers,

Ole J.