P3D sketch not working in Python mode of Processing - processing

I was translating a Java sketch to a Python sketch in Processing. It is using the P3D engine and it is not showing anything in the window while it is showing what I want in Java mode. When I run it just shows a blank black window instead of a grid. I can change its background color but I can not draw in the shapes or something window. Please help me! And I can not share its code as it is not an open source project.

It was my fault. It was a mistake in the code. I was making the grid using for loop and the variables that were needed for for loop were not defined properly it was not giving an error because the value of variables was 0. Sorry for wasting your time. Enjoy!

Related

Looping Images without GIF's

Gifs display bad on my dark game background. So I saved all the 21 frames individually. Put them in my data folder. Now I need them to independently loop and at the mouse pressed command to stop looping. How are the code lines to import all of the 21 images and then have them loop and stopped when mouse is being pressed?
Start smaller.
Can you write a little example sketch that loads a single image and displays it? Take a look at the loadImage() reference here: https://www.processing.org/reference/loadImage_.html
Can you then expand that little example sketch to show two images that alternate when you press the mouse? Can you add a delay between the switching so you can see each image?
Then can you expand that little example sketch to show all 21 images? The ArrayList reference might be useful to you: https://www.processing.org/reference/ArrayList.html
When you get stuck on one of those little example sketches, post it as an MCVE and ask a specific question, and we'll go from there.

Making a bouncing effect using Tweener

I would like to bounce my actor on y-axis for two
Seconds following a button release event.
I don't know how I can do that using Tweener.
Gnome shell 3.4.
Thanks for any help,
I gave up trying that effect. Instead using Tweener (imports.gi.Tweener), I simply set the opacity of the object from 0 to 255 in 'easeQuadEffect'.
GPaste Integration does what you want. Inspecting the code may be informative.
Search for "Tweener" in the gpaste_integration.js file.

How do I save the whole matlab gui panel?

I can save a particular figure or an axes by using export_fig procedure. The command used is like the following:
export_fig(handles.Myfigure, filename). % This code is available on line
But I am trying to save a copy of the main gui (like a screen shot of the whole for record keeping). I guess this could work if I knew the handle of the main panel.
Can anyone help?
Thanks
http://www.mathworks.com/help/techdoc/ref/getframe.html
Get coords of window and dimensions and pass it to this function.

Using images in Matlab GUI

I'm working on a small image processing project in MATLAB. I have worked with MATLAB before, but never created a GUI. The GUI I want to create could be pretty advanced, so I need some hints on how to get started.
The purpose of the GUI would be to load an image and have it shown to the user. The user then has to click on two points in the image, of which the coordinates are stored (in pixels) in a variable. If possible, a colored dot is shown where the user has clicked. After the user finished with the current image, he can load a next one.
I have some experience with Java, and I think this wouldn't be too hard in Swing. But MATLAB seems like not having the purpose of creating such an advanced GUI. However, the whole project until now is in MATLAB, so it would be nice if I could manage to do it. Any help? Hints? Things I should look at?
Thanks a lot.
This is not a very complex task to be done in MATLAB.
For simple instructions about adding a picture to a GUI, take a look at this post:
http://blogs.mathworks.com/pick/2007/10/16/matlab-basics-setting-a-background-image-for-a-gui/
For instructions on various interactions between GUI axes and the mouse pointer, check this video (keep in mind that your picture in the GUI lies within normal MATLAB axes):
http://blogs.mathworks.com/pick/2008/05/27/advanced-matlab-capture-mouse-movement/
In general, Doug's tutorial videos are great for MATLAB beginners, and I'd advise you to take a look at more of them.

What is a robust method for capturing screen of child window in Windows 7?

Pardon my frustration. I've asked about this in many places and I seriously don't think that there wouldn't be a way in Windows 7 SDK to accomplish this.
All I want, is to capture part of a 'child window' ( setParent() ) created by a parent. I used to do this with bitblt() but the catch is that the child window can be any type of application, and in my case has OpenGL running in a section of it. If I bitblt() that, then the OGL part comes blank, doesn't get written to the BMP.
DWM, particularly dwmRegisterThumbnail() doesn't allow thumbnail generation of child windows. So please give me a direction.
Thanks.
It's been a while since I did any of this, so my explanation might be a bit vague, but from what I remember, the Windows doesn't "see" the OpenGL rendered inside the window.
What Windows does is create the window at the specified size and then "hands it over" to OpenGL for rendering. This means that you can't get at the pixels as rendered from the Windows side of the code.
When we wanted to capture the 3D we had to re-render the screen to an off screen bitmap which was then saved (or printed).
Obviously a whole screen capture (Print Screen) works because it's reading the final pixels.
I suggest that you:
Forget the Thumbnail part of the task (in terms of capture).
Calculate where your window is.
Capture full screen.
Excise the area you are interested in (using data from step 2).
Rescale to the appropriate thumbnail size.
Sorry, its more work, but it should work, which is better than what you have right now.
This may help:
http://code.google.com/p/telekinesis/source/browse/trunk/Mac/Source/glgrab.c?r=140
http://www.codeproject.com/KB/dialog/screencap.aspx
Also Java's Robot class (http://java.sun.com/javase/6/docs/api/java/awt/Robot.html#createScreenCapture%28java.awt.Rectangle%29)
I don't have access to the source code of any child window that may be open including the one with OpenGL

Resources