Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8331751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:30:43+00:00 2026-06-09T02:30:43+00:00

I will explain the situation. I am trying to work out how to pause

  • 0

I will explain the situation. I am trying to work out how to pause the camera when a marker has appeared. What i mean by a marker is shown from this link.

http://code.google.com/p/andar/

When the mark has appeared I want a way to pause the camera so the marker wont disappear even though the camera moves. I need this so when playing a game the camera can be jogged but the marker will still stay in the right place. Here is the code form the marker activity

public class CustomActivity extends AndARActivity {

CustomObject2 someObject;
ARToolkit artoolkit;
@Override
public void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    CustomRenderer renderer = new CustomRenderer();//optional, may be set to null
    super.setNonARRenderer(renderer);//or might be omited
    try {
        //register a object for each marker type
        artoolkit = super.getArtoolkit();
        someObject = new CustomObject2
            ("test", "patt.hiro", 80.0, new double[]{0,0});
        artoolkit.registerARObject(someObject);
        someObject = new CustomObject2
        ("test", "android.patt", 80.0, new double[]{0,0});
        artoolkit.registerARObject(someObject);
        someObject = new CustomObject2
        ("test", "barcode.patt", 80.0, new double[]{0,0});
        artoolkit.registerARObject(someObject);
    } catch (AndARException ex){
        //handle the exception, that means: show the user what happened
        System.out.println("");
    }       
    startPreview();
}

/**
 * Inform the user about exceptions that occurred in background threads.
 * This exception is rather severe and can not be recovered from.
 * TODO Inform the user and shut down the application.
 */
public void uncaughtException(Thread thread, Throwable ex) {
    Log.e("AndAR EXCEPTION", ex.getMessage());
    finish();
}

}

@Override

draw function used to draw the cube

public final void draw(GL10 gl) {
        super.draw(gl);

        gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_SPECULAR,mat_flash);
        gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_SHININESS, mat_flash_shiny);    
        gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_DIFFUSE, mat_diffuse);  
        gl.glMaterialfv(GL10.GL_FRONT_AND_BACK, GL10.GL_AMBIENT, mat_ambient);

        //this code draws the cube. 
        gl.glColor4f(0, 1.0f, 0, 1.0f);
        gl.glTranslatef( 0.0f, 0.0f, 12.5f );


        // experement with the api
        //draw the box
      box.draw(gl);
    }

Would I wrap code around the startPreview function. Or do I need to check to see if the object is drawn and then stop the preview in that manner.

I found this command but i am not sure how to implement it for when the marker is being displayed. I know i need some of condition but not sure what it is.
camera.stopPreview();

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:30:44+00:00Added an answer on June 9, 2026 at 2:30 am

    Maybe try adding some code that will stop sending the camera preview buffer for processing. That way it will keep rendering the camera preview but will not process new frames.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK, this is impossible, but I will try to explain the situation here. Let's
I will attempt to explain this situation as clearly as I can. I have
I will try to explain the situation as it is a little bit more
First I will explain what I am trying to do. I am trying to
Ok this is strange but I will explain what is going on. In SQL
I am trying to reduce some code here. I will explain how I have
First I will explain the current situation. I've 2 different threads in 2 services(read
This will be a bit difficult to explain but I will try my best.
First, I'll explain the situation and the logic that I'm trying to implement: I
To understand the question I will explain the situation: main.jsp - the main window

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.