Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to use image instead of custom box in Augment Reality android
    primarykey
    data
    text
    <p>I am new in Android AS WELL IN Augmented Reality and i am facing some problem in AR .</p> <p>That i am using an example of AndAR and in this example i can see simple cube box on my markers.</p> <p>But i want to use my own image on my marker instead of that in build cube.</p> <p>And i want to use different image for different markers.</p> <p>this is my code:- where cube is generated.</p> <pre><code>public class CustomObject extends ARObject { public CustomObject(String name, String patternName, double markerWidth, double[] markerCenter) { super(name, patternName, markerWidth, markerCenter); float mat_ambientf[] = {0f, 1.0f, 0f, 1.0f}; float mat_flashf[] = {0f, 1.0f, 0f, 1.0f}; float mat_diffusef[] = {0f, 1.0f, 0f, 1.0f}; float mat_flash_shinyf[] = {50.0f}; mat_ambient = GraphicsUtil.makeFloatBuffer(mat_ambientf); mat_flash = GraphicsUtil.makeFloatBuffer(mat_flashf); mat_flash_shiny = GraphicsUtil.makeFloatBuffer(mat_flash_shinyf); mat_diffuse = GraphicsUtil.makeFloatBuffer(mat_diffusef); } public CustomObject(String name, String patternName, double markerWidth, double[] markerCenter, float[] customColor) { super(name, patternName, markerWidth, markerCenter); float mat_flash_shinyf[] = {50.0f}; mat_ambient = GraphicsUtil.makeFloatBuffer(customColor); mat_flash = GraphicsUtil.makeFloatBuffer(customColor); mat_flash_shiny = GraphicsUtil.makeFloatBuffer(mat_flash_shinyf); mat_diffuse = GraphicsUtil.makeFloatBuffer(customColor); } private SimpleBox box = new SimpleBox(); private FloatBuffer mat_flash; private FloatBuffer mat_ambient; private FloatBuffer mat_flash_shiny; private FloatBuffer mat_diffuse; /** * Everything drawn here will be drawn directly onto the marker, * as the corresponding translation matrix will already be applied. */ @Override 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); //draw cube gl.glColor4f(0, 1.0f, 0, 1.0f); gl.glTranslatef( 0.0f, 0.0f, 12.5f ); box.draw(gl); } @Override public void init(GL10 gl) { // TODO Auto-generated method stub } </code></pre> <p>Please help me out to overcome from this problem.</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload