fillPolygon in Canvas / Surface - playn

is there some way to perform the java AWT Graphics.fillPolygon method
in a Surface or a Canvas of playn framework ?
Thank you

Use Path and Canvas.fillPath.
Reading the Javadocs for the main PlayN classes will save you from the slow process of asking and waiting for an answer on Stack Overflow for such trivial questions in the future.

Related

QtDataVisualization applications with QML and C++ back-end - is it possible?

I'm developing applications to display very large lidar/sonar datasets (millions of points). QML/Qt seems an attractive platform, since in theory one can quickly define the UI with QML, and implement the "back-end" with high-performance C++. The QtDataVisualization package also seems very useful, especially the Surface3D and Surface3DSeries components for my application. But the provided examples either demonstrate a pure QML approach - which is impractical for my application, with millions of points - or a pure C++ ("widget") approach - which loses the benefit of quickly designing the UI with QML and is locked to a desktop computing platform.
Can someone point to a working example showing how to set QML Surface3DSeries data from C++? This seems theoretically possible from the documentation, but I have been unable to do it, and none of the provided examples demonstrate it. Is this even possible, or is Qml/Qt "broken" in this regard?
Thanks,
Tom
It is possible, but not officially supported and not documented.

How low level the drawing requirements should be to use OpenGl than abstractions like QtOpenGl?

I am required to do some 3-D application and planning to chose some library for the same. I have previous experience with Qt-qml.
I read about OpenGl and found that it must be used basically when you one has very low level drawing requirements.
I also found that there is something called QtOpenGl.
Q1. Is QtOpenGl any less powerfull that OpenGl because it just just provide a wrapper over some OpenGl functionality? or it as good as using OpenGl with an advantage of working at higher level of abstraction ?
Q2. I also found there is something called Qt-3D and Qt-Quick3D. I ran some sample examples and found it easy to use because of my previous experience with qml.
Can someone share experience how powerful it is compared to OpenGl itself?
My basic question is how low the drawing requirements should be that I should use OpenGl rather than some higher abstraction like QtOpenGl ?
Q1: The Qt OpenGL module is not exactly a wrapper aroung OpenGL. It is a wrapper around GLX, WGL, or AGL. You can anyway render with QPainter using the Qt OpenGL engine. Look to the documentation to see if it is sufficiently low for you. Only 2D anyway.
Q2: Qt3D will be part of Qt5 as far as I know. It depends on what you want to do. If you want to implement 3D games it is probably quite risky. Only you know if it is sufficient for your needs.

jogl picking example

hi guys
i am in trouble with add picking object in a JOGL project.
i know that this could be done with pick buffer.. but i can't find examples
anyone?
In general, as you are probably aware, JOGL code translates directly from any other OpenGL examples you might see on the web.
GL_SELECT based picking seems to be very much out of favour these days; deprecated in the spec and poorly implemented by drivers.
Alternatives you can use are:
Rendering each object with a unique color (and all lighting / fog etc disabled) so you can determine which object the mouse is over via glReadPixels. (Clearing buffers after the picking stage so that you can then render your normal graphics). This approach is explained by the top rated answer in OpenGL GL_SELECT or manual collision detection? for example.
Ray-casting into your geometry (see the selection FAQ link below). This also means that you don't have to have an active gl context in the thread you call the code from, fwiw.
I've used both of these methods in the same application, currently having good results with the latter, but since most of the objects in that application are spheres it is a lot cheaper than it might be with arbitrary models.
http://www.opengl.org/resources/faq/technical/selection.htm

When do you throw a prototype away and start over?

When you're prototyping a new system, what guideline(s) do you use to mark a stop-and-start-over point?
Typically I write prototypes as part of the architecture/design process, to answer questions that can only be answered by actually working with the code. For example, questions such as:
Can I do drag & drop in Silverlight?
What framework would I use to draw interactive canvas objects in WinForms?
Usually you can write a prototype fairly quickly to answer such questions. Obviously the code does not have to be production-quality, it just has to go far enough to answer these questions.
Once you run out of open questions, I would scrap the prototype and finish your "design". Then you are ready to begin creating a production version.
When the one I'm working on doesn't fit the requirements anymore (functional, usability, or otherwise).
Prototypes are meant to be a dispossable item so I never hesitate when throwing one away.
When you've de-risked the functionality to a level where you feel ready to write production code.

multithreading in adobe flex

i want to know if i can use threading model like posix or any else in flex, i am a beginer of flex and i want to know if i can use threads in it for multitasking.
No, your Flash/Flex code will only run on a single thread, but you can achieve a lot through the asynchronous/event model.
Flex and ActionScript are single-threaded, so there's no threading model you can use.
http://cookbooks.adobe.com/post_Is_multi_threading_possible_in_Flash_or_ActionScri-12026.html
this is official from adobe
You can use the concept of Green Threads to provide multi threading in your Flex app.
Check this link for a sample implementation of Green Threads.
You would basically have to split your processing into chunks and use the main thread to run your thread along with your normal app.

Resources