How to free draw and erase on a MATLAB GUI? - matlab

I wanted to create a gui that worked as a canvas for free drawing lines with the mouse and with option of erasing...
anyone can help me?

The simplest solution is to look at how other people have implemented this. For example, searching for freehand on the File Exchange brings up this freehand drawing function.
As a basic idea, you'll want to either regularly capture the mouse position, or to evaluate a callback on mouse movement.

Related

How can I add a button in Mapbox to toggle the measure tool on and off?

I'm using this Mapbox example for creating a measuring tool.
https://docs.mapbox.com/mapbox-gl-js/example/measure/
However, I want to have a small icon button that toggles the tool on and off. I don't always need to measure distances. Much like the polygon draw example here:
https://docs.mapbox.com/mapbox-gl-js/example/mapbox-gl-draw/
I can't quite figure out how to do it. Any direction would be great here. I'm still learning.
SOLVED: I took a better look at the mapbox draw documentation and saw that it supports length as well. This meant I was simply able to switch out the area.

Rendering a 3D object from four different angles

I am working on a project where I have to render 4 different sides of a 3D object at the same time on the screen. The output should have 4 different camera outputs rendering the front side, left side, right side and back side of the 3d object.
I found that a gaming engine like Unity may help to do something like this. However, I have just started using Unity and can't figure out how to do it.
Here is the link for some examples. This is how I want the output to look like
Well first of all, welcome to Stackoverflow. And you are right, Unity is an excellent IDE to achieve what you described.
As stated in the FAQ and here, I'm going to give you an answer I deem fitting to your question. I can post the code here in about 30 minutes which does exactly what you asked for, but then we'd miss the point of learning to program and posting at StackOverflow in general. I'll show you the way on how to start on this project, but then you'll have to try yourself. If you have any troubles after trying some more, we can help you with specific problems, provided you have researched some before and show us what you tried.
As to your question, it's relative easy to do so. First create your object in the scene, then drag and place four different Camera-objects in the screen. Using the Camera's Normalized View Port Rect (Four values that indicate where on the screen this camera view will be drawn, in Screen Coordinates (values 0-1)), you can then split up the view to show the feed of each Camera.
This ofcourse happens in a script. You can read here about Scripting in Unity. Even if you are an expert in programming, that link is worth a read when you are new to Unity.
Good luck.

Matlab. Image processing on 8 ball pool flash game. Small cheat. Hehe

See the picture below. It's a flash game from a well known website :)
http://imageshack.us/photo/my-images/837/poolu.jpg/
I'd like to capture the images, frame by frame, using Matlab, and then lenghten the line that goes from the 8 ball, the short one, so i can see exactly where it will go. And display another window, in which the exact pool table will appear but with longer lines for the paths :)
I know, or can easily find out, how to capture the screen and whatnot, the problem is that i'm not sure how to start detecting those lines, to see the direction they are heading towards. Can anyone suggest an idea on how to accomplish this? Any image processing techniques i could use to at least filter out everything except those lines.
Not sure where to even start looking, or for WHAT.
And yeah, it's a cheat i know. But i got programming skills, why not put them in practice? :D Help me out people, it's a fun project :)
Thanks.
I would try using the Hough transform in the Matlab Image Processing Toolbox.
EDIT1:
Basically the Hough transform is a technique for detecting linear structures (lines) in an image.

Simple form with pixel manipulation in Qt

I'm completely newbie to Qt
i want to create a 800X600 window that just show some circle and be able to manipulate pixels of the form. there is no interaction between user and form(no click, no dblclick,...) it just shows some circles with one color and lines with different pixel colors(each line may have different pixel colors)
also i want to be able to change the coordination system, i mean change it from top-left to the center of the window. could anyone help me do that with some sample code?
thanks in advance for your reply.
Please try downloading the Qt Creator (IDE), then reading through the tutorials. There's a whole host of very useful information provided for free, including a lot of the code samples you are looking for.
The following examples might also be of particular interest:
Animation Framework Examples
Graphics View Examples
Painting Examples

How to draw points,lines and get coordinates in canvas in PLT scheme?

I am newbie in PLT scheme (using DrScheme). So, this question may be annoying to many developers.
I want to draw points in every click (mouse event) in a canvas and get the coordinate of that point. Also I want to draw a line from the last point to the last mouse event point.
As per documentation, they suggested to use world.ss (instead of draw.ss) from teachpack. But I am not getting it how to do that.
Now how will I do that? Any suggestion or hints are appreciated.
Thanks in advance.
If you're interested in writing such programs, and especially if you're new to Scheme, then have a look at the new How to Design Worlds book.