graphics

Movement of a surgical robot's arm OpenGL

徘徊边缘 提交于 2019-12-11 17:57:28
问题 I have a question concerning surgical robot arm's movements in OpenGL. Our arm consists of 7 pieces that suppose to be the arm's joints and they are responsible for bending and twisting the arm. We draw the arm this way: first we create the element which is responsible for moving the shoulder like "up and down" and then we "move" using Translatef to the point in which we draw the next element, responsible for twisting the shoulder (we control the movement using Rotatef) and so on with the

Native WebGL particle system opacity issue

不想你离开。 提交于 2019-12-11 17:54:07
问题 I am trying to render textured particles and i have the problem. Transparent pixels of texture doing a weird thing with render. Looks like particles that are behing nearest (to camera) particles are not rendering at all. But not always, some of them are rendering and look expected. I was tried to play around with depth and blend options but without result. Perhaps that a solution can be found by modifying this part code. gl.enable(gl.DEPTH_TEST); gl.enable(gl.BLEND); gl.blendFunc(gl.SRC_ALPHA

Some trouble with paintComponent()

时光怂恿深爱的人放手 提交于 2019-12-11 17:52:38
问题 Following a previous message, I have another problem (what a newbie). I have a class Fenetre , containing the following code (and more) : @Override public void paintComponent(Graphics g) { super.paintComponent(g); if(!init) { afficher= new Afficher(g); init = true; } g.setColor(Color.white); g.fillRect(0, 0, 1000, 500); if(lol)afficher.setMapOne(2,2,6); System.out.println("paintComponent : "+lol); afficher.checkChanges(g); } public void setLol(boolean n) { lol = n; System.out.println("setLol

extends GraphicsProgram

对着背影说爱祢 提交于 2019-12-11 17:43:13
问题 I'm watching the Programming Methodology from Stanford on Youtube and professor uses the GraphicsProgram as a basic class for the class he creates. I do: public class Test extends GraphicsProgram { public static void main(String[] args) { } } But getting the error that GraphicsProgram can't be resolved to a type. I clicked Ctrl + Shift + O being in Eclipse to import required packages but nothing happened. Just wondered how professor uses it, please tell me if you know, thanks in advance! 回答1:

Camera preview is letterboxed when on portrait

有些话、适合烂在心里 提交于 2019-12-11 17:33:02
问题 I'm using the cameraPreview sample coming with the Android API demos. The problem is, the camera preview is showing properly on landscape, but when I rotate the phone to portrait, I get a letterboxed and rotated image. I'm using Android 2.3.3 and a Samsung Galaxy Ace, but also tried 2.1 on a Xperia Mini 10 Pro. A couple of pics (sorry for poor the quality): portrait http://i42.tinypic.com/a9qzuu.jpg Is this normal behavior of the demo program? What's a proper way to fix it? 回答1: This helped

Java Swing How to scale triangle

丶灬走出姿态 提交于 2019-12-11 16:59:44
问题 I would like to draw some random triangles and scale them, when I'm changing the size of my window. I have a separate class MyTriangle that extends MyShape . I also have two variables: scaleX and scaleY . Whenever I try to multiply triangle x and y values and change the window size, triangles go crazy and suddenly disappear. When I try to write graphics.fillPolygon(new int[]{(int)(x1*scX),(int)(x2*scX)(int)(x3*scX)}, new int[]{(int)(y1*scY),(int)(y2*scY),(int)(y3*scY), 3); Nothing happens in

HitTest not working correctly when using Graphics.lineTo/curveTo

大城市里の小女人 提交于 2019-12-11 16:46:38
问题 So I have a Movie Clip called hookLine thats added to the stage from my mainEngine class. This empty movieClip is connected to my fisherman Movie Clip and curves to my playerHook Movie Clip. Its added and connected to the stage like so: In My mainEngine function loop: playerHookLine(); Then the Function: private function playerHookLine():void { //Add hook line to fisherman and playerhook hookLine.graphics.clear(); hookLine.graphics.lineStyle(1); hookLine.graphics.moveTo(fisherman.x, fisherman

Using KoolPlot On Linux (Linux Mint 10)? Or Is it for MingW Only..?

笑着哭i 提交于 2019-12-11 16:45:23
问题 I need to plot real time statistics for a data transfer being done using udp (socket) protocol for my project. Stats like the average speed, total throughput, etc. My code is in C++. As I googled first, I liked the "koolplot" implementation for plotting 2-D graphs/plots a lot. But when I compiled it/tried to take up the example koolplot app. I simply wasn't able to resolve the missing "graphics.h". My best guess is that it's not there in linux. Is it? Thats for BGI graphics under borland. Eh?

how to transform an image with a transformation Matrix in OpenCv?

这一生的挚爱 提交于 2019-12-11 16:34:15
问题 i want to transform an entire image according to the magnitude of a straight line (y=ax+b) with an angle ( arcTan(a) ) this angle should be applied just to the y axis of all the points. i wanted to use the warpAffine(...) method but what I was able to make work with this method is using points (generally 3) in the image so that warpAffine(...) can figure out the angle for itself and transform that part of the image, and that's not what I need because I want to transform the whole image not

How to add a new JFrame with buttons?

穿精又带淫゛_ 提交于 2019-12-11 16:32:53
问题 Whenever I create a new JFrame screen the game won't run on my computer for some reason and I don't know why. I have tried fixing this issue but I think it has something to do with the buttons or the placement of the screen. The startStage is what I need help on. If I'm missing something can you please tell me. import java.awt.CardLayout; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event