Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - SteveRaphaellos

Pages: [1]
1
German corner / OnTouchEvent erweiterung ... ?
« on: December 14, 2013, 11:25:46 pm »
Hallo Community,
was brauche ich, um ein Objekt sich solange bewegen zu lassen, wie der Finger an Position (x+-50/y+-50) ist (bei "boolean onTouchEvent(MotionEvent e)")?
Ich meine MotionEvent.ACTION_MOVE ist nicht das wirklich richtige, da ich den Finger auf dem gemalten Button immer hin und her bewegen müsste,
ich möchte aber eine Spielsteuerung in der man den Finger nur auf den Button halten muss...
Ich hab's mit 'ner while-Schleife mit der Bedinung getAction()!=MotionEvent.ACTION_UP probiert, läuft aber irgendwie falsch.^^
Die wird dann leider zur Endlosschleife ...

Danke im Vorraus :)
LG SteveRaphaellos

2
Support / Move a Cube (just a Primitives.getCube(...) Cube)
« on: December 11, 2013, 05:49:08 pm »
Hello Community.
Im new here and i didn't find my topic (I'm a bad Googler or it's not existing ? :p) yet.
So I ask you : How to move a cube which just needs to be a Primitives cube ?
What do I need to change in the following to move the cube?

Peace of code :

int SIZE = 64;
Context mastercontext = null;
FrameBuffer fb = null;
World world = null;
RGBColor back = new RGBColor(50, 50, 100);
Light sun = null;
Object3D cube = null;

@Override
   public void onSurfaceChanged(GL10 gl, int width, int height) {
      if(fb != null)
         fb.dispose();
      
      fb = new FrameBuffer(gl, width, height);
      
      if(masteractivity == null) {
         world = new World();
         world.setAmbientLight(120, 120, 120);
         sun = new Light(world);
         sun.setIntensity(250, 250, 250);
         
         Texture tex = new Texture(BitmapHelper.rescale(BitmapHelper.
               convert(mastercontext.getResources().getDrawable(R.drawable.test)), SIZE, SIZE));
         
         TextureManager.getInstance().addTexture("tex", tex);
         cube = Primitives.getCube(10);
         cube.calcTextureWrapSpherical();
         cube.setTexture("tex");
         cube.strip();
         cube.build();
         
         world.addObject(cube);
         
         Camera cam = world.getCamera();
         cam.moveCamera(Camera.CAMERA_MOVEOUT, 50);
         cam.lookAt(cube.getTransformedCenter());
         
         SimpleVector sv = new SimpleVector();
         sv.set(cube.getTransformedCenter());
         sv.y = -100;
         sv.x = -100;
         sun.setPosition(sv);
         MemoryHelper.compact();
      }
   }

Thanks for reading until this line, hope you can help. ;)
>> SteveRaphaellos <<

Pages: [1]