Search Results

Search found 354 results on 15 pages for 'cam spiers'.

Page 8/15 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Permutation of Strings in C++

    - by cam
    I'm looking for just a simple method for permutating strings/integers in C++. I can easily do it in C#, but I'm just learning C++ and can't seem to find the right methods. Can someone show me a simple example that will find all permutations of an integer? And then the exact same for a string?

    Read the article

  • Incremental Union?

    - by cam
    I'm trying to describe a Sudoku Board in C++ with a union statement: union Board { int board[9][9]; int sec1[3][3]; int sec2[3][3]; int sec3[3][3]; int sec4[3][3]; int sec5[3][3]; int sec6[3][3]; int sec7[3][3]; int sec8[3][3]; int sec9[3][3]; } Would each section of the board correspond with the correct part of the array? IE, Would sec4 correspond with board[4-6][0-3]? Is there a better way to do this sort of thing (specifically describing a sudoku board)?

    Read the article

  • Read All Files in Directory?

    - by cam
    How would I go about reading all files in a directory? In C# I would get a DirectoryInfo object, and get all files into a FileInfo[] object. Is there similar functionality in the STD namespace in C++?

    Read the article

  • ffserver - streaming problem transcodation for input

    - by zozo
    Good day to all. I have a little problem. I'm trying to stream something from a cam to a server and then forward to... somewhere (it will be a site or something). On the computer that I have the cam connected to I use vlc to stream it to the server and there I try to get the stream as an input for a ffserver. The problem is that ffserver doesn't detect the input (regardless of the protocol I use (udp, rtp, etc.)). I suspect a transcoding problem or something like that but I can't find any documentation about that so... Does any1 know what transcodation I should use? Thank you for help and have a great day.

    Read the article

  • Looking for an easier Skype video chat alternative

    - by Paul
    Is there any software 'easier to use' than Skype - ie to get a video conversation going you have to turn on the computer, make sure the speakers are turned on, make sure the web cam is connected, make sure you click answer with Video... I would like to buy a 'single red button' which does all of the above. - Any recommendations? Update @Eric Koslow comment My original question title was "Is there any software/hardware 'easier to use' than Skype?" So the answer is not necessarily a computer running a program, although it might be. I realise Skype makes a good attempt at helping to ensure speakers and web cam are working and helps you to sort them out if they are not, and for a person who isnt computer phobic this should be enough. However I am interested if there is anything available that is 'easier' than this - ie I'm looking for my 'single' red button. ie the mobile phone with video call maybe the closest answer so far, but I would prefer something as 'free' as Skype is.

    Read the article

  • Seeking webcam with own IP address

    - by Mawg
    I am not sure if this is the correct place to post, but I couldn't find anywhere better. I am looking for a webcam/movie cam and this site seems more addressed to still images, but ... I am looking for a small, rugged web-cam which can be hand-held or perhaps head-mounted (failing that I can settle for a tripod mount, but I need portability). It must have its own IP address so that anyone can view its video stream from a web browser. I would prefer 2 way voice communication too. Encryption of data is nice, as is compression (H.264). Maybe also remote control, like causing it to zoom from the browser. Does anyone have any suggestions, even suggestions of somewhere else to look? Thanks very much in advance.

    Read the article

  • Windows 8 isn't detecting PS3 eye

    - by JonFriesen
    I have the PS3 Eye web cam installed with drivers from Code Laboratories, which comes with a test program. When I open the test program it shows a clear picture from the webcam. Every other program does not detect a webcam. The cam shows in my device manager and as installed correctly. My question is, is there a flag or something like that I can set that will show Windows 8 that this device is in fact a camera and is working. Here is a picture of the test program that comes loaded with the drivers and the windows 8 camera app. Thanks for the help! **Here is a pic, I can't integrated because I haven't posted enough on superuser :P http://i48.tinypic.com/6qyw6t.png

    Read the article

  • guvciew/youtube problem

    - by Anonymous
    I'm fairly new to Linux. Running on 12.10 Ubuntu. I've been running into some problems recording videos. Cheese crashes (as I've read from other users), YouTube will not allow me to select Allow (flash in Chrome and in Firefox). I managed to get 1 video uploaded from my cam and it worked about half the time, cut the audio off, lagged, etc. My computer is fine 4gigs, 32-bit i5 so it shouldn't be a problem. Now onto guv, I managed to get 1 video to work and after that every video I save it comes up with an orange file that looks like a film. I tried to change the file name, open in VLC, everything. I love Ubuntu and I'm never going back to Windows, ever One other thing to note is I am allowed to click "allowed" in Tiny chat. I even went to the adobe website to allow everything to bypass allow, deny option and nothing. Even went out of my way to add youtube/upload/cam for it to allow it and nothing. I realize right now Flash has been terrible for the past couple of months (especially in Chrome). What my question is well first and foremost, how do I fix this, if possible? I've thought about running Wine but I haven't heard anything good about it and I've already re reformated Ubuntu twice. Is there a codec pack I need too? Like I said everything works fine, especially in Chrome. It allows me to broadcast, no lag, and my mic works fine. guv would be my best option at this point because everything I've tried has given me nothing but trouble Thanks and I hope you guys can give me an answer. I've been at this for 2-3 days straight now. I could even go out of my way to not use Youtube and use something similar if it came down to it.

    Read the article

  • Java Slick2d - How to translate mouse coordinates to world coordinates

    - by Corey
    I am translating in my main class render. How do I get the mouse position where my mouse actually is after I scroll the screen public void render(GameContainer gc, Graphics g) throws SlickException { float centerX = 800/2; float centerY = 600/2; g.translate(centerX, centerY); g.translate(-player.playerX, -player.playerY); gen.render(g); player.render(g); } playerX = 800 /2 - sprite.getWidth(); playerY = 600 /2 - sprite.getHeight(); Image to help with explanation I tried implementing a camera but it seems no matter what I can't get the mouse position. I was told to do this worldX = mouseX + camX; but it didn't work the mouse was still off. Here is my Camera class if that helps: public class Camera { public float camX; public float camY; Player player; public void init() { player = new Player(); } public void update(GameContainer gc, int delta) { Input input = gc.getInput(); if(input.isKeyDown(Input.KEY_W)) { camY -= player.speed * delta; } if(input.isKeyDown(Input.KEY_S)) { camY += player.speed * delta; } if(input.isKeyDown(Input.KEY_A)) { camX -= player.speed * delta; } if(input.isKeyDown(Input.KEY_D)) { camX += player.speed * delta; } } Code used to convert mouse worldX = (int) (mouseX + cam.camX); worldY = (int) (mouseY + cam.camY);

    Read the article

  • libgdx ActorGestureListener.pan() parameters not moving actor in smooth line

    - by Roar Skullestad
    I override the pan method in ActorGestureListener to implement dragging actors in libgdx (scene2d). When I move individual pieces on a board they move smoothly, but when moving the whole board, the x and y coordinates that is sent to pan is "jumping", and in an increasingly amount the longer it is dragged. These are an example of the deltaY coordinates sent to pan when dragging smoothly downwards: 1.1156368 -0.13125038 -1.0500145 0.98439217 -1.0500202 0.91877174 -0.984396 0.9187679 -0.98439026 0.9187641 -0.13125038 This is how I move the camera: public void pan (InputEvent event, float x, float y, float deltaX, float deltaY) { cam.translate(-deltaX, -deltaY); I have been using both the delta values sent to pan and the real position values, but similar results. And since it is the coordinates that are wrong, it doesn't matter whether I move the board itself or the camera. What could the cause be for this and what is the solution? When I move camera only half the delta-values, it moves smoothly but only at half the speed of the mouse pointer: cam.translate(-deltaX / 2, -deltaY / 2); It seems like the moving of camera or board affects the mouse input coordinates. How can I drag at "mouse speed" and still get smooth movements? (This question was also posted on stackoverflow: http://stackoverflow.com/questions/20693020/libgdx-actorgesturelistener-pan-parameters-not-moving-actor-in-smooth-line)

    Read the article

  • Xna Equivalent of Viewport.Unproject in a draw call as a matrix transformation

    - by Nick Crowther
    I am making a 2D sidescroller and I would like to draw my sprite to world space instead of client space so I do not have to lock it to the center of the screen and when the camera stops the sprite will walk off screen instead of being stuck at the center. In order to do this I wanted to make a transformation matrix that goes in my draw call. I have seen something like this: http://stackoverflow.com/questions/3570192/xna-viewport-projection-and-spritebatch I have seen Matrix.CreateOrthographic() used to go from Worldspace to client space but, how would I go about using it to go from clientspace to worldspace? I was going to try putting my returns from the viewport.unproject method I have into a scale matrix such as: blah = Matrix.CreateScale(unproject.X,unproject.Y,0); however, that doesn't seem to work correctly. Here is what I'm calling in my draw method(where X is the coordinate my camera should follow): Vector3 test = screentoworld(X, graphics); var clienttoworld = Matrix.CreateScale(test.X,test.Y, 0); animationPlayer.Draw(theSpriteBatch, new Vector2(X.X,X.Y),false,false,0,Color.White,new Vector2(1,1),clienttoworld); Here is my code in my unproject method: Vector3 screentoworld(Vector2 some, GraphicsDevice graphics): Vector2 Position =(some.X,some.Y); var project = Matrix.CreateOrthographic(5*graphicsdevice.Viewport.Width, graphicsdevice.Viewport.Height, 0, 1); var viewMatrix = Matrix.CreateLookAt( new Vector3(0, 0, -4.3f), new Vector3(X.X,X.Y,0), Vector3.Up); //I have also tried substituting (cam.Position.X,cam.Position.Y,0) in for the (0,0,-4.3f) Vector3 nearSource = new Vector3(Position, 0f); Vector3 nearPoint = graphicsdevice.Viewport.Unproject(nearSource, project, viewMatrix, Matrix.Identity); return nearPoint;

    Read the article

  • JBox2D applyLinearImpulse doesn't work

    - by Romeo
    So i have this line of code: if(input.isKeyDown(Input.KEY_W)&&canJump()) { body.applyLinearImpulse(new Vec2(0, 30), cam.screenToWorld(body.getPosition())); System.out.println("I can jump!"); } My problem is that the console display I can jump! but the body doesn't do that. Can you explain to me if i do something wrong? Some more code. This function creates my 'hero' the one supposed to jump. private Body setDynamic(float width, float height, float x, float y) { PolygonShape shape = new PolygonShape(); shape.setAsBox(width/2, height/2); BodyDef bd = new BodyDef(); bd.allowSleep = true; bd.position = new Vec2(cam.screenToWorld(new Vec2(x + width / 2, y + height / 2))); bd.type = BodyType.DYNAMIC; bd.userData = new BodyInfo(width, height); Body body = world.createBody(bd); body.createFixture(shape, 10); return body; } And this is the main update loop: if(input.isKeyDown(Input.KEY_A)) { body.setLinearVelocity(new Vec2(-10*delta, body.getLinearVelocity().y)); } else if (input.isKeyDown(Input.KEY_D)) { body.setLinearVelocity(new Vec2(10*delta, body.getLinearVelocity().y)); } else { body.setLinearVelocity(new Vec2(0, body.getLinearVelocity().y)); } if(input.isKeyDown(Input.KEY_W)&&canJump()) { body.applyLinearImpulse(new Vec2(0, 30), body.getPosition()); System.out.println("I can jump!"); } world.step(delta * 0.001f, 10, 5); }

    Read the article

  • Java Slick2d - Mouse picking how to take into account camera

    - by Corey
    When I move it it obviously changes the viewport so my mouse picking is off. My camera is just a float x and y and I use g.translate(-cam.cameraX+400, -cam.cameraY+300); to translate the graphics. I have the numbers hard coded just for testing purposes. How would I take into account the camera so my mouse picking works correctly. double mousetileX = Math.floor((double)mouseX/tiles.tileWidth); double mousetileY = Math.floor((double)mouseY/tiles.tileHeight); double playertileX = Math.floor(playerX/tiles.tileWidth); double playertileY = Math.floor(playerY/tiles.tileHeight); double lengthX = Math.abs((float)playertileX - mousetileX); double lengthY = Math.abs((float)playertileY - mousetileY); double distance = Math.sqrt((lengthX*lengthX)+(lengthY*lengthY)); if(input.isMousePressed(Input.MOUSE_LEFT_BUTTON) && distance < 4) { if(tiles.map[(int)mousetileX][(int)mousetileY] == 1) { tiles.map[(int)mousetileX][(int)mousetileY] = 0; } } That is my mouse picking code

    Read the article

  • translation/rotation of a HUD against a camera using vectors in Euclidian 3D space

    - by Jakob
    i've got 2 points in 3D space: the camera position and the camera lookAt. the camera movement is restricted akin to typical first person shooter games. you can move the cam freely, tilt horizontally and up to 90 degrees vertically, but not roll. so now i want to draw a HUD to the screen, on which i can move the mouse freely, with the position of the cursor correctly translating into 3D space. the easy part was to draw something directly in front of the camera. V0 = camPos; V1 = lookAt; V2 = lookAt-camPos; normalize V2; mutiply V2 according to camera frustum V3 = V0+V2 draw something at V3 now the part i don't get: i could use V3 and add to that the rotations of the cam combined with the x/y of the mouse cursor, somehow, right? that's what i want.

    Read the article

  • Mac dashboard widgets not loading external images

    - by andrhamm
    I set out to make a quick Mac OS X dashboard widget. I read the documentation and was pleased to find out they use simple HTML, JS, and CSS. I created my widget and it works when I open the .html file in Firefox, but it does not work when I install the widget to the dashboard. The widget is simple: it displays the most recent image from a weather web cam stream. The image URLs look like this: http://webcam.com/stream.jpg?1274213999617. The timestamp is appended to the URL and the server automatically responds with the latest image for that time. I did not write the server script. The widget appears to be loading correctly, but the web cam image will not load. Notice the blue question mark in the upper left. The image should appear over the square background image. Is there any special procedure for loading external images into a widget?

    Read the article

  • Pointers to Derived Class Objects Losing vfptr

    - by duckworthd
    To begin, I am trying to write a run-of-the-mill, simple Ray Tracer. In my Ray Tracer, I have multiple types of geometries in the world, all derived from a base class called "SceneObject". I've included the header for it here. /** Interface for all objects that will appear in a scene */ class SceneObject { public: mat4 M, M_inv; Color c; SceneObject(); ~SceneObject(); /** The transformation matrix to be applied to all points of this object. Identity leaves the object in world frame. */ void setMatrix(mat4 M); void setMatrix(MatrixStack mStack); void getMatrix(mat4& M); /** The color of the object */ void setColor(Color c); void getColor(Color& c); /** Alter one portion of the color, leaving the rest as they were. */ void setDiffuse(vec3 rgb); void setSpecular(vec3 rgb); void setEmission(vec3 rgb); void setAmbient(vec3 rgb); void setShininess(double s); /** Fills 'inter' with information regarding an intersection between this object and 'ray'. Ray should be in world frame. */ virtual void intersect(Intersection& inter, Ray ray) = 0; /** Returns a copy of this SceneObject */ virtual SceneObject* clone() = 0; /** Print information regarding this SceneObject for debugging */ virtual void print() = 0; }; As you can see, I've included a couple virtual functions to be implemented elsewhere. In this case, I have only two derived class -- Sphere and Triangle, both of which implement the missing member functions. Finally, I have a Parser class, which is full of static methods that do the actual "Ray Tracing" part. Here's a couple snippets for relevant portions void Parser::trace(Camera cam, Scene scene, string outputFile, int maxDepth) { int width = cam.getNumXPixels(); int height = cam.getNumYPixels(); vector<vector<vec3>> colors; colors.clear(); for (int i = 0; i< width; i++) { vector<vec3> ys; for (int j = 0; j<height; j++) { Intersection intrsct; Ray ray; cam.getRay(ray, i, j); vec3 color; printf("Obtaining color for Ray[%d,%d]\n", i,j); getColor(color, scene, ray, maxDepth); ys.push_back(color); } colors.push_back(ys); } printImage(colors, width, height, outputFile); } void Parser::getColor(vec3& color, Scene scene, Ray ray, int numBounces) { Intersection inter; scene.intersect(inter,ray); if(inter.isIntersecting()){ Color c; inter.getColor(c); c.getAmbient(color); } else { color = vec3(0,0,0); } } Right now, I've forgone the true Ray Tracing part and instead simply return the color of the first object hit, if any. As you have no doubt noticed, the only way the computer knows that a ray has intersected an object is through Scene.intersect(), which I also include. void Scene::intersect(Intersection& i, Ray r) { Intersection result; result.setDistance(numeric_limits<double>::infinity()); result.setIsIntersecting(false); double oldDist; result.getDistance(oldDist); /* Cycle through all objects, making result the closest one */ for(int ind=0; ind<objects.size(); ind++){ SceneObject* thisObj = objects[ind]; Intersection betterIntersect; thisObj->intersect(betterIntersect, r); double newDist; betterIntersect.getDistance(newDist); if (newDist < oldDist){ result = betterIntersect; oldDist = newDist; } } i = result; } Alright, now for the problem. I begin by creating a scene and filling it with objects outside of the Parser::trace() method. Now for some odd reason, I cast Ray for i=j=0 and everything works wonderfully. However, by the time the second ray is cast all of the objects stored in my Scene no longer recognize their vfptr's! I stepped through the code with a debugger and found that the information to all the vfptr's are lost somewhere between the end of getColor() and the continuation of the loop. However, if I change the arguments of getColor() to use a Scene& instead of a Scene, then no loss occurs. What crazy voodoo is this?

    Read the article

  • Using Sandy 3D AS3, fill the viewport (exact fit) with multiple 3D objects.

    - by Andrew Mullins
    I'm stitching together an image using multiple instances of the sandy.primitive.Box. Each box is 96x91 while the viewport is 960x273 which should make for an exact fit if I layout the boxes in a perfect grid of 10x3. However, I can't seem to get the exact camera fieldOfView. I've tried a couple formulas (one for adjusting the "focal length" and one for adjusting the fov, directly). Both of these formulas produce a fov angle that is too narrow. // focal length (stage.stageHeight/2) / Math.tan(cam.fov / 2 * Math.PI / 180) // field of view 2 * Math.atan2( (stage.stageHeight/2), -cam.z ) * (180 / Math.PI) Another question about the same project: I need to adjust the perspective of each cube so that the image appears to be in 2D space (flat)... Any ideas on the best method for calculating such a "correction"?

    Read the article

  • OpenCv not initializing usb camera

    - by brainbarshan
    I am trying to capture video from usb camera using OpenCv. #include <highgui.h> #include <iostream> using namespace std; using namespace cv ; int main() { VideoCapture cap (-1); if(!cap.isOpened()) cout << "Cam initialize failed" ; else cout << "Cam initialized" ; return 0; } It is failing to initialize the camera. cap.isOpened() is returning zero. The same program, with same version of OpenCv and same usb camera, is correctly running in my friend's machine. I am running fedora 16. I did some searching in Google and Stack Overflow. But no useful help. Any idea ?

    Read the article

  • Solving the problem of finding parts which work well with each other

    - by dotnetdev
    Hi, I have a database of items. They are for cars and similar parts (eg cam/pistons) work better than others in different combinations (eg one product will work well with another, while another combination of 2 parts may not). There are so many possible permutations, what solutions apply to this problem? So far, I feel that these are possible approaches (Where I have question marks, something tells me these are solutions but I am not 100% confident they are). Neural networks (?) Collection-based approach (selection of parts in a collection for cam, and likewise for pistons in another collection, all work well with each other) Business rules engine (?) What are good ways to tackle this sort of problem? Thanks

    Read the article

  • Axis Aligned Billboard: how to make the object look at camera

    - by user19787
    I am trying to make an Axis Aligned Billboard with Pyglet. I have looked at several tutorials, but they only show me how to get the Up,Right,and Look vectors. So far this is what I have: target = cam.pos look = norm( target - billboard.pos ) right = norm( Vector3(0,1,0)*look ) up = look*right gluLookAt( look.x, look.y, look.z, self.pos.x, self.pos.y, self.pos.z, up.x, up.y, up.z ) This does nothing for me visibly. Any idea what I'm doing wrong?

    Read the article

  • 5 Best WordPress Themes for creating Reviews & Ratings Websites

    - by Aditi
    WordPress CMS is so powerful, we have seen variety of websites being made with WordPress. It is not limited to just blogging. You can build robust community driven websites as well. Recently I cam across these themes, as I was trying to build such a similar reviews, ratings community website. I have reviewed all of [...] Related posts:10+ Best Fashion WordPress Themes 21+ WordPress Photo Blog & Portfolio Themes 12 Best WordPress Themes for Church

    Read the article

  • How do I implement camera axis aligned billboards?

    - by user19787
    I am trying to make an axis-aligned billboard with Pyglet. I have looked at several tutorials, but they only show me how to get the up, right, and look vectors. So far this is what I have: target = cam.pos look = norm(target - billboard.pos) right = norm(Vector3(0,1,0) * look) up = look * right gluLookAt( look.x, look.y, look.z, self.pos.x, self.pos.y, self.pos.z, up.x, up.y, up.z ) This does nothing for me visibly. Any idea what I'm doing wrong?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >