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?
Thanks in advanced
|
|
0
|
|
|
|
Reply
|
Amit
|
4/22/2010 10:10:19 AM |
|
"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
|
|
|
|
Reply
|
Steven
|
4/22/2010 1:42:50 PM
|
|
"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
|
|
|
|
Reply
|
Amit
|
4/22/2010 4:39:05 PM
|
|
"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
|
|
|
|
Reply
|
Steven
|
4/22/2010 5:40:06 PM
|
|
"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
|
|
|
|
Reply
|
Amit
|
4/24/2010 12:43:07 AM
|
|
|
4 Replies
199 Views
(page loaded in 0.048 seconds)
Similiar Articles: Plotting Matlab figures on the Server - comp.soft-sys.matlab ...Hello, This is the blank figure window issue and is most likely caused by the OpenGL driver installed on ... interp') title('Smooth interpolation using OpenGL') set ... opengl save as jpeg - comp.soft-sys.matlab... comp.soft-sys.matlab The size of the output is determined by a combination of the figure size and ... opengl save as jpeg - comp.soft-sys.matlab using openGL on figures ... Export figures to bmp or jpg. Change bit depth or size - comp.soft ...Sometimes opengl throws up errors when using print - it's a reliability issue with that MATLAB function. You can email me the figure if you like. Figure initial position - comp.soft-sys.matlabHello. Now, I'm very nervous about the initial posiition of figures. I know that figure position can be changed using some commands. However, I j... easiest way to store orientation and do rotations of a ball ...Currently I'm trying to figure out the best way to store the orientation of a ball ... of storing x,y,z positions of the initial "top" of the ball, then somehow using opengl ... Warning - Texture data too large for graphics device. Fitting to ...Hello, I have a set of figures that require readjustment of the y-limits and font ... interp') title('Smooth interpolation using OpenGL') set(gcf,'Renderer','OpenGL ... set a figure always on the top of all the others - comp.soft-sys ...How can I set a figure to be always on top of all the others? I have been seing ... Smooth interpolation using OpenGL') set(gcf ... Answers Best Answer: There are two ways ... OpenGL vs Direct3D - comp.graphics.api.opengl... arguments for a migration to Direct3D in favor of proprietary aero-glass toys has ... My GPU is ati mobility x1600, and I use opengl + GLSL. ... opengl picking vs ... Direct3D vs. OpenGL - scene graph libraries - comp.graphics.api ...I think one of the most important reasons for using OpenGL is that there are a lot of ... Microsoft's deliberate* "API churn"(TM) means that nobody has time to figure ... To display a 3D skeleton, what do I need to learn? - comp.graphics ...Since you already know C, I'd probably reccomend learning OpenGL using C/C++/Objective C. ... articulated > on a string found in craft stores - to visualise various figure ... Define figure properties - MATLAB - MathWorks - MATLAB and ...The figure contains less than 10 uicontrols (OpenGL clipping around uicontrols is slow). No line objects use markers (drawing markers is slow). You do not specify Phong ... Write a program in C/C++ using OpenGL to draw a figure of a ...Best Answer: I take it you are doing an OpenGL course, there are quite a few ways to do that really you should be going onto the openGL site they have all ... 7/27/2012 1:17:39 AM
|