Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you get rajawali to work (tutorial 1 on git)
    primarykey
    data
    text
    <p>I am quite new to android development, I know the basics activities, maps, sqlite, etc. I would like to be able to implement some 3D objects to be able to interact with within my apps. After a bit of searching I found that rajawali seems to be the best method. As you do I started with the first tutorial and reading the source code from the example docs. Where I have become lost is I have followed the tutorial word for word and and I cant run the application due to errors in the script. If anybody has used Rajawali before I would appreiate some pointers as to where I have gone wrong. (the tutorial was last updated 2 month ago so its quite recent). <a href="https://github.com/MasDennis/Rajawali/wiki/Tutorial-01----Basic-Setup-&amp;-a-Sphere">Tutorial</a></p> <p>Here is my source code</p> <p>MainActivity:</p> <pre><code>package rajawali.tutorials; import rajawali.RajawaliActivity; import android.os.Bundle; import android.view.Menu; public class MainActivity extends RajawaliActivity { private Renderer mRenderer; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mRenderer = new Renderer(this); mRenderer.setSurfaceView(mSurfaceView); super.setRenderer(mRenderer); } } </code></pre> <p>Renderer:</p> <pre><code>package rajawali.tutorials; import javax.microedition.khronos.opengles.GL10; import android.content.Context; import rajawali.lights.DirectionalLight; import rajawali.materials.textures.ATexture.TextureException; import rajawali.materials.textures.Texture; import rajawali.primitives.Sphere; import rajawali.renderer.RajawaliRenderer; public class Renderer extends RajawaliRenderer { private DirectionalLight mLight; Sphere mSphere; public Renderer(Context context) { super(context); setFrameRate(60); } public void initScene() { mLight = new DirectionalLight(1f, 0.2f, -1.0f); mLight.setColor(1.0f, 1.0f, 1.0f); mLight.setPower(2); try { *DiffuseMaterial* material = new *DiffuseMaterial*(); //there is an error here (DiffuseMaterial cannot be rsolved as a type) material.addTexture(new *Texture(R.drawable.earthtruecolor_nasa_big)*); //here (constructor Texture(int) cannot be defined) mSphere = new Sphere(1, 24, 24); mSphere.setMaterial(material); mSphere.*addLight(mLight)*; //and here (The method addLight(DirectionalLight) is undefined for the type Sphere) addChild(mSphere); } catch (TextureException e) { e.printStackTrace(); } getCurrentCamera().setZ(4.2f); } @Override public void onDrawFrame(GL10 glUnused) { super.onDrawFrame(glUnused); mSphere.setRotY(mSphere.getRotY() + 1); } } </code></pre> <p>I don't realy want to be spoon feed code if I can help it but it appears that the error is in the 'DiffuseMaterial'. Why is this or is there a better way of manipulating 3D objects other than using min3D or Rajawali?</p>
    singulars
    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.
    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