COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### using openGL on figures

• Email
• Follow

Hi.

I am plotting 3D points, about 10000 of them, and the figure is very sluggish when I rotate it.

I read in the help on figure properties that openGL is by default on.

I was wondering if matlab is using my graphics card and if not how can I make it use it?

when I type "opengl info" I get the following:

***************
Version         = 3.2.0
Vendor          = NVIDIA Corporation
Renderer        = GeForce 8400M G/PCI/SSE2
MaxTextureSize  = 8192
Visual          = 07 (RGB 32 bits(08 08 08 00) zdepth 24, Hardware Accelerated, Opengl, Double Buffered, Window)
Software        = false
# of Extensions = 180

Driver Bug Workarounds:
OpenGLBitmapZbufferBug    = 0
OpenGLWobbleTesselatorBug = 0
OpenGLLineSmoothingBug    = 0
OpenGLDockingBug          = 0
OpenGLClippedImageBug     = 1
OpenGLEraseModeBug        = 1
****************

Is there something I can do to accelerate figure performance?


 0

See related articles to this posting

"Amit " <snufkinvic@yahoo.com> wrote in message
news:hqp7ab$hb5$1@fred.mathworks.com...
> Hi.
>
> I am plotting 3D points, about 10000 of them, and the figure is very
> sluggish when I rotate it.

Are you plotting the ten thousand points individually (i.e. creating 10000
individual line objects) or are you plotting them in groups (i.e. creating 1
or a small number of line objects)?

If the former, try to modify your code to plot in groups (or if they all
have the same marker shape, size, and color in one single line) and see if
that performs any better.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


 0

"Steven Lord" <slord@mathworks.com> wrote in message <hqpjoi$h24$1@fred.mathworks.com>...
>
> "Amit " <snufkinvic@yahoo.com> wrote in message
> news:hqp7ab$hb5$1@fred.mathworks.com...
> > Hi.
> >
> > I am plotting 3D points, about 10000 of them, and the figure is very
> > sluggish when I rotate it.
>
> Are you plotting the ten thousand points individually (i.e. creating 10000
> individual line objects) or are you plotting them in groups (i.e. creating 1
> or a small number of line objects)?
>
> If the former, try to modify your code to plot in groups (or if they all
> have the same marker shape, size, and color in one single line) and see if
> that performs any better.
>
> --
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>

Hi Steve.

I'm not sure if I understand you...

I'm plotting the points using "plot3" function inside a "for" loop as following:

plot3(X(i),Y(i),Z(i),'b*');

where i runs on the vectors X,Y and Z, in this case they are of the size 10,000

Is there a better, more efficient way of doing that?

 0

"Amit " <snufkinvic@yahoo.com> wrote in message
news:hqpu39$bs1$1@fred.mathworks.com...
> "Steven Lord" <slord@mathworks.com> wrote in message
> <hqpjoi$h24$1@fred.mathworks.com>...
>>
>> "Amit " <snufkinvic@yahoo.com> wrote in message
>> news:hqp7ab$hb5$1@fred.mathworks.com...
>> > Hi.
>> >
>> > I am plotting 3D points, about 10000 of them, and the figure is very
>> > sluggish when I rotate it.
>>
>> Are you plotting the ten thousand points individually (i.e. creating
>> 10000 individual line objects) or are you plotting them in groups (i.e.
>> creating 1 or a small number of line objects)?
>>
>> If the former, try to modify your code to plot in groups (or if they all
>> have the same marker shape, size, and color in one single line) and see
>> if that performs any better.
>>
>> --
>> Steve Lord
>> slord@mathworks.com
>> comp.soft-sys.matlab (CSSM) FAQ:
>> http://matlabwiki.mathworks.com/MATLAB_FAQ
>
> Hi Steve.
>
> I'm not sure if I understand you...
>
> I'm plotting the points using "plot3" function inside a "for" loop as
> following:
>
>         plot3(X(i),Y(i),Z(i),'b*');
>
> where i runs on the vectors X,Y and Z, in this case they are of the size
> 10,000

So you are in fact creating 10,000 lines.

> Is there a better, more efficient way of doing that?

Either plot all the points at once after the loop is complete:

plot3(X, Y, Z, 'b*')

or, if you need the plot to update inside the loop, preallocate X, Y, and Z
to be vectors of NaNs, replace the appropriate element of X, Y, and Z inside
the loop and use REFRESHDATA to tell the plot to update to reflect the new
non-NaN elements of X, Y, and Z.

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/refreshdata.html

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


 0

"Steven Lord" <slord@mathworks.com> wrote in message <hqq1ld$gi2$1@fred.mathworks.com>...
>
> "Amit " <snufkinvic@yahoo.com> wrote in message
> news:hqpu39$bs1$1@fred.mathworks.com...

>
> So you are in fact creating 10,000 lines.
>
> > Is there a better, more efficient way of doing that?
>
> Either plot all the points at once after the loop is complete:
>
> plot3(X, Y, Z, 'b*')
>
> or, if you need the plot to update inside the loop, preallocate X, Y, and Z
> to be vectors of NaNs, replace the appropriate element of X, Y, and Z inside
> the loop and use REFRESHDATA to tell the plot to update to reflect the new
> non-NaN elements of X, Y, and Z.
>
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/refreshdata.html
>
> --
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>

Thanks for the suggestion. I moved the plotting to be outside of the "for" loop but unfortunately I don't notice any improvement. I even tried plotting only 1500 points but its still not as smooth as I expect it to be.

Any other suggestions?
What about the openGL functionality? How can I know its on?

 0

4 Replies
218 Views

Similar Articles

12/13/2013 10:36:34 AM
[PageSpeed]

Similar Artilces:

matlab opengl figure performance: how to use hardware acceleration
Hello, I am trying to plot some figures really fast using pcolor (which is an actually 2D surface). I tried to use the opengl hardware acceleration but got nothing improvement. using opengl software: K>> opengl software K>> opengl info Version = 1.1.0 Vendor = Microsoft Corporation Renderer = GDI Generic MaxTextureSize = 1024 Visual = 09 (RGB 32 bits(08 08 08 00) zdepth 32, Generic, Opengl, Double Buffered, Window) Software = true # of Extensions = 3 Driver Bug Workarounds: OpenGLBitmapZbufferBug = 1 OpenGLWobbleTessel...

old-style figures (text figures) ... how to actually use?
Previous discussion on old-style (text) figures: http://groups-beta.google.com/group/comp.text.tex/browse_frm/thread/d7871b7e3b3c7a12/e86469814e9a1921#e86469814e9a1921 I've now installed and am using old-style figures using a Adobe Pro version of a font, as suggested, using the excellent LCDF type tools and the "LY1" encoding: http://www.lcdf.org/~eddietwo/type/index.html These tools produce multiple fonts from each OpenType font input, each with different options. For instance, from one OpenType font input, I produced four fonts: regular, small-caps, old-style-figures, and s...

Generate eyediagram figure (or other object types) using a specific figure number
Is it possible to generate an eyediagram figure using a specific figure number? I have tried specifying it via the function argument as follows. h = figure(6); eyediagram(zn,Nos,1,0,'',h); However, figure(6) has to already be an eyediagram object. How do I convert a generic figure into a specific object? Thanks in advance! ...

Array used in OpenGL
Can someone show me how to show this as the one dimensional 16-entry array used in OpenGL, or tell me where to find a good example of these examples. ex) A martrix for rotation of 60 degrees around the axis r=(1,1,1). ex) a projection matrix for a viewing frustum with a field of view of 90 degrees, an aspect ratio of 4/3, a near plane at distance 1, and a far plane at distance 100. George wrote: > Can someone show me how to show this as the one dimensional > 16-entry array used in OpenGL, or tell me where to find a good > example of these examples. > > ex) A martrix for rot...

How to use particles in OpenGL
Anybody knows how to handle particles with OpenGL? I can't find about it on conventional OpenGL books. JuanLievano wrote: > Anybody knows how to handle particles with OpenGL? I can't > find about it on conventional OpenGL books. OpenGL is not a complete 3D engine. So everything that goes beyond drawing fancy triangles is up to you. Google is your friend. http://www.google.de/search?q=OpenGL+Particle+Tutorial Wolfgang Draxinger -- ...

Using PyQT and OpenGL
Hi folks, Although the PyQt documentation indicates that QGLWidget & friends have been ported to Python for the PyQt bindings, I'm not entirely sure what's necessary to make the normal OpenGL/GLUT interface available. Does PyQt work okay with PyOpenGL? Or is a more complicated workaround needed? If anyone has experience with working with Python/Qt/OpenGL and can offer any advice I'd much appreciate it. Thanks, Peter -- Quake II build tools maintainer http://tinyurl.com/fkldd v2sw6YShw7\$ln5pr6ck3ma8u6/8Lw3+2m0l7Ci6e4+8t4Eb8Aen5+6g6Pa2Xs5MSr5p4 hackerkey.c...

Including figures using WinEdt
Hi, I'm very new to TeX and am having some trouble including figures in my document. I have the following headers: \documentclass{report} \usepackage{graphicx} And when I attempt to insert a figure, my code is: \begin{figure}[hr] \begin{center} \includegraphics[height=2in]{2-10.eps} \end{center} \end{figure} The file 2-10.eps is in the same directory as my .tex file. When I compile it in WinEdt (using MikTeX) by clicking the LaTeX button, it seems to compile fine. I can then view the dvi file, which looks ok - except that there it's blank where the figures can be. Can anyone h...

povray and opengl install and use?
I would like to manipulate a 3D skeleton. On the opengl list, it was suggested povray would be easier to learn, and perhaps more powerful than opengl. I did find rupov There are recent books on opengl, but I don't find any book on pov-ray and I don't see any example of the use of pov-ray with ruby. I did not find a library of opengl commands either. How do people figure out how to use pov-ray or opengl for ruby? I have installed opengl for ruby opengl-0.32g, and the examples compile fine in that directory, but not in other directories? What could have gone wrong in the install of ope...

question on using opengl extensions
hi, recently, i've been trying to build a program that uses opengl extensions. i'm developing in .Net and on windows. i managed to compile all the code successfully but during linking, the following error msgs appeared. meshvbo.obj : error LNK2005: _glDeleteBuffersARB already defined in font.obj meshvbo.obj : error LNK2005: _glBufferDataARB already defined in font.obj meshvbo.obj : error LNK2005: _glBindBufferARB already defined in font.obj meshvbo.obj : error LNK2005: _glGenBuffersARB already defined in font.obj terrain.obj : error LNK2005: _glDeleteBuffersARB already defined in fon...

How do I figure out what command line ffmpegX is using?
I'm using ffmpegX to convert some WMA files to MP3. I'd really like to know the command line equivalent of whatever ffmpegX is doing so that I can write a little shell script to batch process rather than drag and drop every file individually. Is there any way for me to figure this out? TIA, -Lotofun In article <110920051943435757%lotofun61@yahoo.com>, Lot-o-fun <lotofun61@yahoo.com> wrote: > I'm using ffmpegX to convert some WMA files to MP3. I'd really like to > know the command line equivalent of whatever ffmpegX is doing so that I > can write a lit...

Hello, Is it possible to use the division sign ___ instead of / in matlab figures? Thanks. Mohammad Mohammad Kurdi wrote: > > > Hello, > Is it possible to use the division sign ___ instead of / in matlab > figures? > Thanks. > Mohammad You can set the font, and the ascii character. Alternatively, you can use BsTeX or the Stylized Text Toolbox. ...

Can not use calculator to plot figure
I was trying to plot the rise time of a waveform that I got from a simulation using the calculator function. However it didn't work and I got a warning "Evaluation error (unknown scalar data type:nil) Expression: error)". I used to do this at another machine and it worked. Can anyone tell me how to fix this problem? Thanks. On Jul 24, 3:52=A0pm, Allen <ocean...@yahoo.com> wrote: > I was trying to plot the rise time of a waveform that I got from a > simulation using the calculator function. However it didn't work and I > got a warning "Evaluation error (un...

using *.TGA and *.DDS files with OpenGL?
Is there a library out there (preferably Open Source) that will allow me to use *.TGA and *.DDS files (including the compression and any transparency info contained in them) as textures in OpenGL? The app is running on Win32 but may be ported to other things later on. The library should only use calls from OpenGL, GLUT and C RTL (i.e. no Win32 API calls) PS, the reason I am wanting to use *.DDS (a DirectX format) with OpenGL is because I am writing a viewer for a 3D format that uses *.DDS as textures. If it is not directly possible to use *.DDS files, is there some other way to use th...

Advice on using OpenGL for medical simulation
Hi folks, Sorry if this has been asked before but I searched and couldn't find anything similar in the archives. I am looking into the feasibility of creating a simulation tool for teaching dermatology (skin conditions) to doctors. My ideal tool would be an easy to use 3D simulation of a human body that can be rotated, zoomed, etc for clinical examination. The simulation would need to be able to show photo-realistic skin conditions (eczema, psoriasis, etc) at an appropriate zoom level which would help our doctors make diagnoses as part of their training. As I understand, 3D viewers are a...

performance bottleneck for graphics using OpenGL
Who could explain a bit about the performance bottleneck for graphics applications when using OpenGL? How to avoid such bottlenecks? Thanks, Yong Hu Yong Hu wrote: > Who could explain a bit about the performance bottleneck for > graphics applications when using OpenGL? How to avoid such > bottlenecks? nVidia has an excellent paper about it. In a few words it can be summarized to this: State changes are a major performance hit, especially texturing and material state changes. Sort all geometry by texture and material before rendering and batch them. If you're concerned abou...

how to use subplot to plot 10 figures
Can any one help me to subplot 10 figures in one plot. I would appreciate your help or if you could write it down the partitions I need to make for subplot. Thanks ...

How to save the figure using the name it shows.
when press the "save figure" button on the figure, it save as filename: "untitled.fig" always but the name I used like "1000-10-2". How to save it as the name of the figure directly but the "untitled.fig" ? Thanks for your attention and help, yuanxin yuanxin wrote: > when press the "save figure" button on the figure, it save as > filename: "untitled.fig" always but the name I used like "1000-10-2". > How to save it as the name of the figure directly but the > "untitled.fig" ? > Thanks for your atten...

Using \table or \figure in the letter class
I assume there must be an easy way to include a table or figure (with caption) rather than than just a tabular environment or something like \begin{center} \resizebox{4cm}{!} {\includegraphics{OtherNations}} \end{center} I would like something along the lines of \begin{table} \caption{Blah blah blah} \begin{tabular}[ht] {|l|p{4cm}|p{4cm}|p{4cm}|} \hline Day & Breakfast & Lunch & Dinner \\ \hline Monday & & & \\[3cm] \hline Tuesday & & & \\[3cm] \hline \end{tabular} \end{table} These environments dont's see to be recognized in the let...

Problem using one opengl application.
Hi All, I am using one opengl application flight simulator tool namely Flightgear under open source. It gives a 45 degree display. But our work requires 135 degree display. so we have used 3 window display system using 3 different workstations each for 45 degree diaplay and synchronised by genlock. The entire process is on 3D image processing. The problem what we are facing is when we are in ground the runway and other adjacent area looks as a single image. But after take off, the image gets distorted and we are seeing some angle affect in the image. The image is looking as 3 different image...

using opengl to extract text from images
hi, recently i hv started to work on a project which identifies objects in images, what i want to ask is, is there enough libraries in opengl tht can help me do this job. i hv never used opengl before, so i dont know what really to do. i m confused as to should i use the libraries in the vc++ msdn help or should i use open gl (if it comes with libraries and function) to get my job done. regards, roideuniverse roideuniverse wrote: > hi, > recently i hv started to work on a project which identifies > objects in images, > what i want to ask is, is there enough libraries in ...