Search Results

Search found 2495 results on 100 pages for 'camera hacks'.

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

  • Splitting Logic, Data, Layout and "Hacks"

    - by fjdumont
    Sure, we all heard of programming patterns such as MVVM, MVC and such. But that isn't really what I'm looking into as Layout, Data and Logic is already pretty much split up (XML-Layout markup, Database, insert your language of choice here). The platform I am developing for is hard to maintain over the updated versions and older OSes. The project significantly grew up over the last few months and dealing with different platform versions really is a pain. For example simply disabling an user interface control for all existing versions took me around 40 lines of code in the logic layer, wrangling around with invocation, delegation, singletons that provide UI handling and so on. Is there a clean way to keep track of those "hacks" by maybe excluding it into separate classes or even packages? Should I overwrite existing framework code in order to handle my requirements correctly? If so, does that concept have a name?

    Read the article

  • Test de la caméra Raspberry Pi 5M, tutoriel par Nicolargo

    Bonjour,Nous avons précédemment publié le tutoriel :Raspberry Pi : Déballage et installationComme suite nous proposons ce tutoriel : Test de la caméra Raspberry Pi 5M Citation: Raspberry propose depuis peu et pour moins de 25 € une caméra dédiée à sa gamme Pi. Cette caméra de quelques grammes se connecte à une Raspberry Pi (modèle A ou B) à travers une interface CSI v2 (MIPI camera interface) dédiée. Grâce à Kubii (fournisseur Farnell en France), j'ai pu obtenir rapidement...

    Read the article

  • IP Camera working on lan but not on internet

    - by Kevin Boyd
    My IP cam model is Genius 350TR, I tested the cam at home on lan and internet and it worked. Then I shifted it to an office. It works on the office lan setup but I cannot connect to the ip cam from home. The IP cam is configured for port 192.168.0.30:7070 and it has a port forwarded to publicIP:7071 When I telnet to that public IP it connects to that port. However when I try to access the ip cam from a web browser it only shows me the configuration page and settings and the video is blank and it says connecting for some time and then says disconnected. The cam is configured for HTTP on internet and UDP on Lan. The office setup is ISP --- WifiRouter --- PC With Wifi card --- Switch --- IP CAM Is there a way to debug this problem?

    Read the article

  • Is any EXIF data stored within 3rd party Camera apps on the iPhone?

    - by 3rdparty
    I'm confused as to if any EXIF data is available when taking photos within 3rd party camera apps on the iPhone. My understanding is that Apple is currently not allowing any apps to save EXIF data to photos, and this is a limitation of saving to the camera roll on the phone. The last FAQ on this page indicates this, but appears to be out of date: http://www.codegoo.com/page/support I love some of the camera apps I've downloaded (Camera Genius, Best Camera, CameraBag) but don't want to continue using them if they aren't saving any/all EXIF data for the image. Anyone aware what the status of this 'limitation' is?

    Read the article

  • Camera and Image recognition

    - by kjh
    I recently watched a youtube video where a guy got a camera to recognize when a rubik's cube was held up to it, and it captured the 9 square color combination before snapping a picture of the cube and displaying the 3x3 grid on the screen of his computer. What kind of programming is this and where would I start reading to get into this sort of thing? specifically, controlling a camera, and getting it to pick out certain parts of an image and translate that data.

    Read the article

  • Why use 3d matrix and camera in 2D world for 2d geometric figures?

    - by Navy Seal
    I'm working in XNA on a 2d isometric world/game and I'm using DrawUserPrimitives to draw some geometric figures... I saw some tutorials about creating dynamic shadows but I didn't understood why they use a "3d" matrix to control the transformations since the figure I'm drawing is in 2d perspective. I know I'm drawing a 2d figure in 3d but I still can't understand if I really need to work with the matrix. Is there any advantage in using a 3d Matrix to control camera and view? Any reason why I can't just update my vertex's positions by using a regular method since the view is always the same... And since I want to work only with single figures, won't this cause all the geometric figures have the same transformations simultaneously? To understand better what I mean here's a video http://www.youtube.com/watch?v=LjvsGHXaGEA&feature=player_embedded

    Read the article

  • UIImagePickerController shows last picture taken instead of camera input

    - by jules
    I'm having a strange behaviour within my app. For taking pictures i'm using the following pretty standard code for displaying the UIImagePickerController: UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.allowsEditing = NO; picker.sourceType = UIImagePickerControllerSourceTypeCamera; [self presentViewController:picker animated:YES completion:nil]; It works perfectly fine the first time I tap the button which calls this action. The strange behaviour starts when I tap that button again. The UIImagePickerController starts again BUT it doesnt show the input from the camera anymore. It shows the last picture I've taken. More Details of this state: Tapping on the image shows the yellow square of the auto focus. (which it actually uses to focus the camera correctly) When I tap on the ImageCapture button - the correct image is taken and presented on the screen. If I take a picture and press 'Retake' the regular camera image is presented as input. More weirdness: It has nothing to do with the iPad I'm using. Creating a new example app which only has button which calls the code from above everything works perfectly fine. I assume it has something to do with the configuration of the app. Therefore I checked everything but could not find any differences which may cause this issue. Thanks in advance for any advice! Update: I do implement the UIImagePickerControllerDelegate in order to dismiss the UIImagePickerController.

    Read the article

  • camera picturecallback intent not work

    - by Simon
    After I take the photo, the program automatically goes back like onBackPressed(). When I remove the putExtra, the intent runs. When I put startActivity() after takePicture(), it transfers null data.... I just want to put the image data to another activity to have other use. How can it be achieved? private PictureCallback picture = new PictureCallback(){ @Override public void onPictureTaken(byte[] data, Camera camera) { // TODO Auto-generated method stub Intent intent = new Intent(CameraFilming.this, PhotoPreview.class); intent.putExtra("imageByte", data); //Picture data transfer to next activity startActivity(intent); } }; //take photo by pressing button private class captureBtnListener implements View.OnClickListener{ @Override public void onClick(View v){ capture.setOnClickListener(null); CountDownTimer timer = new CountDownTimer(10000, 1000){ @Override public void onTick(long millisUntilFinished) { // TODO Auto-generated method stub countdown.setText(millisUntilFinished/1000+""); } @Override public void onFinish() { // TODO Auto-generated method stub countdown.setText("0"); camera.takePicture(null, null, picture); } }; timer.start(); } } public class PhotoPreview extends Activity{ private RelativeLayout layout; private ImageView overlay, texture, face1, face2; @Override public void onCreate (Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.photo_preview); layout = (RelativeLayout)findViewById(R.id.preview_layout); byte[] data = getIntent().getByteArrayExtra("imageByte"); if (data == null){ Log.d("PhotoPreview", "no image data"); finish(); } Bitmap rawPhotoBitmap = BitmapFactory.decodeByteArray(data, 0, data.length); ImageProcess imgProcess = new ImageProcess(this); Bitmap resizedFace = imgProcess.scaleAccordingWidth(imgProcess.cropImage(rawPhotoBitmap, 840, 125, 440, 560), 77); face1 = new ImageView(this); face1.setImageBitmap(resizedFace); Log.d("testing", "testing"); } }

    Read the article

  • Draw camera position in specific view port.

    - by snackbar
    Most of this code should be fairly self explanatory. I got an display function and my view port function. There are two modes which is 4 small view ports in the window or one large. I got one camera which can be moved and if in 4 view port mode just 3 fixed angles. The thing is I want the free moving cameras position to be displayed in the 3 other view ports. I tried doing it by drawing spheres using opengl but the problem is that then the position gets draw in the free roaming camera too as it shows the same scene. It doesn't have to be a sphere, just something simple that represents the cameras spacial position in these three other views. Drawing the scene once with camera object showing for the three viewports, render to texture. Clear and draw scene without camera object render to texture and then stitch these together before actually drawing the scene seems like a lot o work for something that should be easy. void display(int what) { if(what==5){ glMatrixMode(GL_MODELVIEW); glLoadIdentity(); camControll();} if(what==1){ glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(75,15,-5,0,5,-5,0,1,0);} if(what==2){ glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0,110,0,0,0,0,1,0,0);} if(what==3){ glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0f, float(320) / float(240), 0.1f, 100.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); camControll();} if(what==4){ glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(185,75,25,0,28,0,0,1,0);} glClearColor(0, 0, 0, 1); glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); drawScene(); drawCamera(); glutSwapBuffers(); } void viewport(){ glEnable(GL_SCISSOR_TEST); if(!divided_view_port) { glViewport(0, 0, w, h); glScissor(0,0,640,480); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0f, w / h, 0.1f, 100.0f); display(5); } else { ////////////////////// bottom left - working glViewport(0, 0, w/2, h/2); glScissor(0,0,w/2,h/2); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0f, w / h, 0.1f, 300.0f); display(1); ////////////////////// ////////////////////// top right - working glViewport(w/2, h/2, w/2, h/2); glScissor(w/2,h/2,w/2,h/2); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0f, w / h, 0.1f, 300.0f); display(2); ////////////////////// ////////////////////// bottom right -working glViewport(w/2, 0, w/2, h/2); glScissor(w/2,0,w/2,h/2); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0f, w / h, 0.1f, 300.0f); display(3); //////////////////////// ////////////////////////// top left glViewport(0, h/2, w/2, h/2); glScissor(0,h/2,w/2,h/2); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0f, w / h, 0.1f, 300.0f); display(4); /////////////////////////// } glDisable(GL_SCISSOR_TEST); glMatrixMode(GL_MODELVIEW); }

    Read the article

  • Smooth Camera Zoom Factor Change

    - by Siddharth
    I have game play scene in which user can zoom in and out. For which I used smooth camera in the following manner. public static final int CAMERA_WIDTH = 1024; public static final int CAMERA_HEIGHT = 600; public static final float MAXIMUM_VELOCITY_X = 400f; public static final float MAXIMUM_VELOCITY_Y = 400f; public static final float ZOOM_FACTOR_CHANGE = 1f; mSmoothCamera = new SmoothCamera(0, 0, Constants.CAMERA_WIDTH, Constants.CAMERA_HEIGHT, Constants.MAXIMUM_VELOCITY_X, Constants.MAXIMUM_VELOCITY_Y, Constants.ZOOM_FACTOR_CHANGE); mSmoothCamera.setBounds(0f, 0f, Constants.CAMERA_WIDTH, Constants.CAMERA_HEIGHT); But above thing create problem for me. When user perform zoom in and leave game play scene then other scene behaviour not look good. I already set zoom factor to 1 for this purpose. But now it show camera translation in other scene. Because scene switching time it so much small that player can easily saw translation of camera that I don't want to show. After camera reposition, everything works perfect but how to set camera its proper position. For example my loading text move from bottom to top or vice versa based on camera movement. Any more detail you want then I can able to give you.

    Read the article

  • Droid's mediaserver dies on camera.takePicture()

    - by SirBoss
    On Motorola Droid, Firmware 2.1-update1, Kernel 2.9.29-omap1, Build # ESE81 When attempting to take a picture, mediaserver dies with a segmentation fault. I've tried putting takePicture in a timer and running it a few seconds after camera initialization to check for race conditions, but no change. Just calling Camera.open() doesn't cause the crash. Also, calling Camera.open() causes what I think is the autofocus motor to make a sort of ticking sound. Code that breaks: import android.app.Activity; import android.os.Bundle; public final class ChopperMain extends Activity { public void onCreate(Bundle savedInstanceState) { try { Camera camera = Camera.open(); catch (Exception e) { e.printStackTrace(); } camera.takePicture( new Camera.ShutterCallback() { public void onShutter() { ; } }, new Camera.PictureCallback() { public void onPictureTaken(byte[] data, Camera camera) { ; } }, new Camera.PictureCallback() { public void onPictureTaken(byte[] data, Camera camera) { ; } }, new PictureCallback() { public void onPictureTaken(byte[] data, Camera camera) { System.out.println("Ta da."); } } }); } catch (Exception e) { e.printStackTrace(); } } } Debug Log: D/CameraHal(10158): CameraSettings constructor D/CameraHal(10158): CameraHal constructor D/CameraHal(10158): Model ID: Droid D/CameraHal(10158): Software ID 2.1-update1 D/dalvikvm( 988): GC freed 2 objects / 56 bytes in 215ms D/ViewFlipper( 1074): updateRunning() mVisible=false, mStarted=true, mUserPresent=false, mRunning=false I/HPAndroidHAL(10158): Version 2988. Build Time: Oct 26 2009:11:21:55. D/CameraHal(10158): 19 default parameters D/CameraHal(10158): Immediate Zoom/1:0. Current zoom level/1:0 D/CameraHal(10158): CameraHal constructor exited ok D/CameraService(10158): Client::Client X (pid 10400) D/CameraService(10158): CameraService::connect X D/CameraService(10158): takePicture (pid 10400) I/DEBUG (10159): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG (10159): Build fingerprint: 'verizon/voles/sholes/sholes:2.1-update1/ESE81/29593:user/release-keys' I/DEBUG (10159): pid: 10158, tid: 10158 >>> /system/bin/mediaserver <<< I/DEBUG (10159): signal 11 (SIGSEGV), fault addr 00000008 I/DEBUG (10159): r0 00000000 r1 00000000 r2 a969030c r3 a9d1bfe0 I/DEBUG (10159): r4 00045eb0 r5 0000eb10 r6 000153a0 r7 a9c89fd2 I/DEBUG (10159): r8 00000000 r9 00000000 10 00000000 fp 00000000 I/DEBUG (10159): ip a969085c sp bec4fba0 lr a9689c65 pc a9d1bfde cpsr 60000030 I/DEBUG (10159): #00 pc 0001bfde /system/lib/libutils.so I/DEBUG (10159): #01 pc 00009c62 /system/lib/libcamera.so I/DEBUG (10159): #02 pc 00007b0c /system/lib/libcameraservice.so I/DEBUG (10159): #03 pc 00021f98 /system/lib/libui.so I/DEBUG (10159): #04 pc 00015514 /system/lib/libbinder.so I/DEBUG (10159): #05 pc 00018dd8 /system/lib/libbinder.so I/DEBUG (10159): #06 pc 00018fa6 /system/lib/libbinder.so I/DEBUG (10159): #07 pc 000087d2 /system/bin/mediaserver I/DEBUG (10159): #08 pc 0000c228 /system/lib/libc.so I/DEBUG (10159): I/DEBUG (10159): code around pc: I/DEBUG (10159): a9d1bfcc bd1061e3 f7f3b510 bd10e97e 4d17b570 I/DEBUG (10159): a9d1bfdc 6886a300 460418ed fff4f7ff d10a4286 I/DEBUG (10159): a9d1bfec 46234913 20054a13 f06f1869 18aa040a I/DEBUG (10159): I/DEBUG (10159): code around lr: I/DEBUG (10159): a9689c54 e0240412 0204f8d0 050cf104 edf0f7fd I/DEBUG (10159): a9689c64 f7fd4628 f8d4ecf2 b1533204 f852681a I/DEBUG (10159): a9689c74 18581c0c 7101f504 ed82f7fd f8c42000 I/DEBUG (10159): I/DEBUG (10159): stack: I/DEBUG (10159): bec4fb60 4000902c /dev/binder I/DEBUG (10159): bec4fb64 a9d19675 /system/lib/libutils.so I/DEBUG (10159): bec4fb68 00002bb4 I/DEBUG (10159): bec4fb6c a9d1b26f /system/lib/libutils.so I/DEBUG (10159): bec4fb70 bec4fbbc [stack] I/DEBUG (10159): bec4fb74 00095080 [heap] I/DEBUG (10159): bec4fb78 a9c8c028 /system/lib/libcameraservice.so I/DEBUG (10159): bec4fb7c a9c8c028 /system/lib/libcameraservice.so I/DEBUG (10159): bec4fb80 00015390 [heap] I/DEBUG (10159): bec4fb84 a9c89fd2 /system/lib/libcameraservice.so I/DEBUG (10159): bec4fb88 00045ebc [heap] I/DEBUG (10159): bec4fb8c afe0f110 /system/lib/libc.so I/DEBUG (10159): bec4fb90 00000000 I/DEBUG (10159): bec4fb94 afe0f028 /system/lib/libc.so I/DEBUG (10159): bec4fb98 df002777 I/DEBUG (10159): bec4fb9c e3a070ad I/DEBUG (10159): #00 bec4fba0 00045eb0 [heap] I/DEBUG (10159): bec4fba4 00045ebc [heap] I/DEBUG (10159): bec4fba8 000153a0 [heap] I/DEBUG (10159): bec4fbac a9689c65 /system/lib/libcamera.so I/DEBUG (10159): #01 bec4fbb0 a9c8c028 /system/lib/libcameraservice.so I/DEBUG (10159): bec4fbb4 00015390 [heap] I/DEBUG (10159): bec4fbb8 000153a0 [heap] I/DEBUG (10159): bec4fbbc a9c87b0f /system/lib/libcameraservice.so I/DEBUG (10159): debuggerd committing suicide to free the zombie! I/DEBUG (10426): debuggerd: Mar 22 2010 17:31:05 W/MediaPlayer( 1021): MediaPlayer server died! I/ServiceManager( 984): service 'media.audio_flinger' died I/ServiceManager( 984): service 'media.player' died I/ServiceManager( 984): service 'media.camera' died I/ServiceManager( 984): service 'media.audio_policy' died W/Camera (10400): Camera server died! W/Camera (10400): ICamera died E/Camera (10400): Error 100 I/System.out(10400): Camera error, code 100 W/AudioSystem( 1021): AudioFlinger server died! W/AudioSystem( 1021): AudioPolicyService server died! I/ (10425): ServiceManager: 0xad08 E/AudioPostProcessor(10425): E/AudioPostProcessor(10425): AudioMgr Error:Failed to open gains file /data/ap_gain.bin E/AudioPostProcessor(10425): E/AudioPostProcessor(10425): AudioMgr Error:Failed to read gains/coeffs from /data E/AudioPostProcessor(10425): Audio coeffs init success. I/CameraService(10425): CameraService started: pid=10425 D/Audio_Unsolicited(10425): in readyToRun D/Audio_Unsolicited(10425): Create socket successful 10 I/AudioFlinger(10425): AudioFlinger's thread 0x11c30 ready to run E/AudioService( 1021): Media server died. E/AudioService( 1021): Media server started. W/AudioPolicyManager(10425): setPhoneState() setting same state 0

    Read the article

  • CFBundleDocumentTypes and iPad camera connection kit (SD reader)

    - by Kendall Helmstetter Gelner
    I am trying to register a custom document type in an iPad app, with the hopes that I can be prompted to work with files on an SD card attached to the iPad through the camera connection kit. Does anyone know if this is currently possible (or even for sure if it's not possible)? I was hoping that the Camera tab in Photos would use a document interaction controller for types it did not understand, but it seems like Photos does not check for alternate handlers at all - I tried also registering support for the jpg type but was not prompted when using photos and loading in JPG images from an SD card. There is an SD reader app called Zoomit that appears to read many different types from an SD card: http://currentphotographer.com/zoomit-application-enabled-sd-card-reader-for-the-iphone/ But it seems that involves custom hardware, that differs from the standard SD reader.

    Read the article

  • J2ME Camera and Sound Recorder Access On A Windows Mobile

    - by Steven Knox
    I'm currently involved in a research project that requires me to access a Windows Mobile Camera and sound recorder with J2ME to, well take pictures and record sound... the phone has to be a windows mobile for some reason that has nothing to do with me and the software has to be written in Java, also not my decision. So I need to try and find a phone that supports this (if one exists) so I'd like to know if anyone has found one? Thank You For Your Help. (Note the phone supporting MMAPI (JSR 135) does not imply that you can use the camera and sound recorder, our current phone has this and has not access).

    Read the article

  • Save a camera photo with an overlayed image - iphone SDK

    - by user157733
    I think this should be simple but I am having some difficulty implementing it. I take a photo from the camera, the user can then move and scale it. They then choose "use" and they get a preview of their image. Now what I want to do is overlay an image on top of this preview image - which is also ok. But the part I am having difficulty is then I want to save the photo taken WITH the image that is over it into the library. I just have a UIView with my overlay image about the UIView where my camera photo is previewed. I guess I just need to take a screen capture of these? I don't want to loose resolution OR end up with my UI buttons etc in the final image. Any suggestions or links would be really useful. Thanks :-)

    Read the article

  • Retrieve default camera video extension from Windows Mobile

    - by kornelijepetak
    Is there any way to find out what is the default video extension for camera application? I am using CameraCaptureDialog to make the user use the camera and save the image to a specific file which then I consume in the application. However, there is a problem with the videos. Emulator gives .wmv video file while some devices I've been testing save to mp4 format. Is there any reliable way to find out what is the format in which the phone that is running the application saves the file?

    Read the article

  • AIR for Android, Flash iphone packager, Playbook support for streaming camera and choosing camera

    - by mswallace
    I am wondering if anyone can definitively tell me if Flash / AIR can find all these mobile devices front facing camera and use RTMP to stream the video captured ? I would like to create a video conferencing app for these devices. Of course none of them support testing this in the simulators and I don't have the funds to purchase or access all of them that I would like to test. Wondering if anyone can shed some light on this for me. I have seen some posts where they have done this for android but not sure about support for finding a list of cameras, choosing one and streaming from iphone 4 and playbook. thanks for any help on this.

    Read the article

  • Blackbery Axis IP camera Suggestions

    - by user440541
    hello Everyone well i am making an application of IP camera for Blackberry all models. i have gathered all the information regarding coding. now i just wanted a bit of ur help. please guide me through some of the APIs for java through which i could implement live Ip camera video streaming in blackberry. and also some of the references through which i could get help . m new in here pleae guide me thru this everyone. i will be v thankful to u . regards. Thanks a bunch in advance.....

    Read the article

  • Creating a new object destroys an older object with different name in C++

    - by Mikael
    First question here! So, I am having some problems with pointers in Visual C++ 2008. I'm writing a program which will control six cameras and do some processing on them so to clean things up I have created a Camera Manager class. This class handles all operations which will be carried out on all the cameras. Below this is a Camera class which interacts with each individual camera driver and does some basic image processing. Now, the idea is that when the manager is initialised it creates two cameras and adds them to a vector so that I can access them later. The catch here is that when I create the second camera (camera2) the first camera's destructor is called for some reason, which then disconnects the camera. Normally I'd assume that the problem is somewhere in the Camera class, but in this case everything works perfectly as long as I don't create the camera2 object. What's gone wrong? CameraManager.h: #include "stdafx.h" #include <vector> #include "Camera.h" class CameraManager{ std::vector<Camera> cameras; public: CameraManager(); ~CameraManager(); void CaptureAll(); void ShowAll(); }; CameraManager.cpp: #include "stdafx.h" #include "CameraManager.h" CameraManager::CameraManager() { printf("Camera Manager: Initializing\n"); [...] Camera *camera1 = new Camera(NodeInfo,1, -44,0,0); cameras.push_back(*camera1); // Adding the following two lines causes camera1's destructor to be called. Why? Camera *camera2 = new Camera(NodeInfo,0, 44,0,0); cameras.push_back(*camera2); printf("Camera Manager: Ready\n"); }

    Read the article

  • Access the camera of a Smartphone using libGDX

    - by PH-zero
    I searched the web, browsed through the libGDX wiki, but without success. My Question: Is there a way, to access the camera of smartphones, let the user take a photo, and then store the image in a Texture-instance? I could imagin something like this: @Override public void onCamTrigger(){ ApplicationType appType = Gdx.app.getType(); switch (appType) { case Android: case iOS: Texture someTexture = new Texture(Gdx.input.getCamera().getImage()); //do something with the Texture instance... someTexture.dispose(); break; default: break; } } Of course this is pure fiction! I know that there's a lot more to this like opening the camera, displaying it, then take a photo etc. . But is there a convenience method like this? If so, how does it work? On Android, i think i could implement it without using any convenience methods offered by libGDX, but i have no idea on how this works on iOS =/

    Read the article

  • Calculating up-vector to avoid gimbal lock using euler angles

    - by jessejuicer
    I wish to orbit a camera around a sphere, yet the problem is that when the camera rotates so that it is at the north pole (and pointing down) or the south pole (and pointing up) of the sphere the camera doesn't handle itself very well. It spins rapidly until arriving 180 degrees in the opposite direction. I believe this is known as gimbal lock. I understand you can avoid this problem using quaternions. But I also read in another forum that it's possible to avoid this easily using euler angles as well. Which I would prefer to do. It was said that all you need to do is "calculate a proper up-vector every frame, and that avoids the problem entirely." Well, I tried aligning the up-vector with the vertical axis of the camera whenever the camera changed orientation, but this didn't seem to work. Meaning that the up-vector followed exactly the orientation of the camera's y-axis (or it's up vector), instead of using a constant up-vector aligned to the up-vector of the world (0, 1, 0). How exactly do I go about calculating a proper up-vector as my camera orientation changes to avoid the gimbal lock problem mentioned above?

    Read the article

  • Shadows shimmer when camera moves

    - by Chad Layton
    I've implemented shadow maps in my simple block engine as an exercise. I'm using one directional light and using the view volume to create the shadow matrices. I'm experiencing some problems with the shadows shimmering when the camera moves and I'd like to know if it's an issue with my implementation or just an issue with basic/naive shadow mapping itself. Here's a video: http://www.youtube.com/watch?v=vyprATt5BBg&feature=youtu.be Here's the code I use to create the shadow matrices. The commented out code is my original attempt to perfectly fit the view frustum. You can also see my attempt to try clamping movement to texels in the shadow map which didn't seem to make any difference. Then I tried using a bounding sphere instead, also to no apparent effect. public void CreateViewProjectionTransformsToFit(Camera camera, out Matrix viewTransform, out Matrix projectionTransform, out Vector3 position) { BoundingSphere cameraViewFrustumBoundingSphere = BoundingSphere.CreateFromFrustum(camera.ViewFrustum); float lightNearPlaneDistance = 1.0f; Vector3 lookAt = cameraViewFrustumBoundingSphere.Center; float distanceFromLookAt = cameraViewFrustumBoundingSphere.Radius + lightNearPlaneDistance; Vector3 directionFromLookAt = -Direction * distanceFromLookAt; position = lookAt + directionFromLookAt; viewTransform = Matrix.CreateLookAt(position, lookAt, Vector3.Up); float lightFarPlaneDistance = distanceFromLookAt + cameraViewFrustumBoundingSphere.Radius; float diameter = cameraViewFrustumBoundingSphere.Radius * 2.0f; Matrix.CreateOrthographic(diameter, diameter, lightNearPlaneDistance, lightFarPlaneDistance, out projectionTransform); //Vector3 cameraViewFrustumCentroid = camera.ViewFrustum.GetCentroid(); //position = cameraViewFrustumCentroid - (Direction * (camera.FarPlaneDistance - camera.NearPlaneDistance)); //viewTransform = Matrix.CreateLookAt(position, cameraViewFrustumCentroid, Up); //Vector3[] cameraViewFrustumCornersWS = camera.ViewFrustum.GetCorners(); //Vector3[] cameraViewFrustumCornersLS = new Vector3[8]; //Vector3.Transform(cameraViewFrustumCornersWS, ref viewTransform, cameraViewFrustumCornersLS); //Vector3 min = cameraViewFrustumCornersLS[0]; //Vector3 max = cameraViewFrustumCornersLS[0]; //for (int i = 1; i < 8; i++) //{ // min = Vector3.Min(min, cameraViewFrustumCornersLS[i]); // max = Vector3.Max(max, cameraViewFrustumCornersLS[i]); //} //// Clamp to nearest texel //float texelSize = 1.0f / Renderer.ShadowMapSize; //min.X -= min.X % texelSize; //min.Y -= min.Y % texelSize; //min.Z -= min.Z % texelSize; //max.X -= max.X % texelSize; //max.Y -= max.Y % texelSize; //max.Z -= max.Z % texelSize; //// We just use an orthographic projection matrix. The sun is so far away that it's rays are essentially parallel. //Matrix.CreateOrthographicOffCenter(min.X, max.X, min.Y, max.Y, -max.Z, -min.Z, out projectionTransform); } And here's the relevant part of the shader: if (CastShadows) { float4 positionLightCS = mul(float4(position, 1.0f), LightViewProj); float2 texCoord = clipSpaceToScreen(positionLightCS) + 0.5f / ShadowMapSize; float shadowMapDepth = tex2D(ShadowMapSampler, texCoord).r; float distanceToLight = length(LightPosition - position); float bias = 0.2f; if (shadowMapDepth < (distanceToLight - bias)) { return float4(0.0f, 0.0f, 0.0f, 0.0f); } } The shimmer is slightly better if I drastically reduce the view volume but I think that's mostly just because the texels become smaller and it's harder to notice them flickering back and forth. I'd appreciate any insight, I'd very much like to understand what's going on before I try other techniques.

    Read the article

  • Create Adjustable Depth of Field Photos with a DSLR

    - by Jason Fitzpatrick
    If you’re fascinating by the Lytro camera–a camera that let’s you change the focus after you’ve taken the photo–this DSLR hack provides a similar post-photo focus processing without the $400 price tag. Photography tinkers at The Chaos Collective came up with a clever way of mimicking the adjustable depth-of-field adjustment effect from the Lytro camera. The secret sauce in their technique is setting the camera to manual focus and capturing a short 2-3 second video clip while they rotate the focus through the entire focal range. From there, they use a simple applet to separate out each frame of the video. Check out the interactive demo below: Anywhere you click in the photo shifts the focus to that point, just like the post processing in the Lytro camera. It’s a different approach to the problem but it yields roughly the same output. Hit up the link below for the full run down on their technique and how you can get started using it with your own video-enabled DLSR. Camera HACK: DOF-Changeable Photos with an SLR [via Hack A Day] Secure Yourself by Using Two-Step Verification on These 16 Web Services How to Fix a Stuck Pixel on an LCD Monitor How to Factory Reset Your Android Phone or Tablet When It Won’t Boot

    Read the article

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