Comments (8)
Hello
mCamera.setPosition(0, 0, -8);
mCamera.setLookAt(0, 0, 0);
and then...
public void onDrawFrame(GL10 glUnused) {
super.onDrawFrame(glUnused);
mCamera.setRotation(new Number3D(mXOffset*360, mXOffset*360, mXOffset*360));
...
...
I am trying to rotate around 0,0,0, when mXOffset changed, but nothing happened,
mXOffset has a value from 0.0 to 1.0, so not this is the probleme. (GS2)
I changed RajaWaliRenderer class to this:
public void onOffsetsChanged(float xOffset, float yOffset, float xOffsetStep, float yOffsetStep, int xPixelOffset, int yPixelOffset) {
mXOffset=xOffset;
}
public void onTouchEvent(MotionEvent event) {
mTouchEvent=event;
}
to achieve that values from the renderer.
from rajawali.
By saying "rotate around 0,0,0", do you mean to move in a circle with centre at 0,0,0 ?
Just like in https://github.com/MasDennis/RajawaliExamples/blob/master/src/com/monyetmabuk/rajawali/tutorials/RajawaliCatmullRomRenderer.java
Then this example will do.
from rajawali.
Yes. But I not want cam animation. I want to rotate when the user scrolling
on the home screen pages. So camanimation not what I need. I d like to use
xOffset to control rotation...
On May 25, 2012 10:50 PM, "cforcloud" <
[email protected]>
wrote:
By saying "rotate around 0,0,0", do you mean to move in a circle with
centre at 0,0,0 ?
Just like in
https://github.com/MasDennis/RajawaliExamples/blob/master/src/com/monyetmabuk/rajawali/tutorials/RajawaliCatmullRomRenderer.java
Then this example will do.
Reply to this email directly or view it on GitHub:
#25 (comment)
from rajawali.
Any news how to use this?:)
from rajawali.
Sorry, but I have a lot on my todo list. Will look at this later.
from rajawali.
So basically you just have to override the onOffsetsChanged() method in the Renderer class. Then multiply the xOffset by the number of degrees you want to rotate. Also make sure that the camera's lookat isn't set or else it won't rotate.
Example:
public void onOffsetsChanged(float xOffset, float yOffset, float xOffsetStep, float yOffsetStep,
int xPixelOffset, int yPixelOffset) {
mCamera.setRotY(xOffset * 10);
}
from rajawali.
Oh I got it, thats what I needed:
public void onOffsetsChanged(float xOffset, float yOffset, float xOffsetStep, float yOffsetStep, int xPixelOffset, int yPixelOffset) {
//mCamera.setRotY(xOffset * 180);
float x=(float) (10*Math.sin(Math.toRadians(xOffset*360)));
float y=(float) (10*Math.cos(Math.toRadians(xOffset*360)));
mCamera.setLookAt(0, 0, 0);
mCamera.setPosition(x, 0, y);
}
from rajawali.
Cool, glad to hear you've solved your problem :-)
from rajawali.
Related Issues (20)
- build issue com.github.ben-manes.versions not found HOT 3
- jcenter repository has been depracated
- Seeking Luminance based desaturation
- Seeking Lighten and Darken Blend Modes
- Seeking point texture plugin
- improving SpriteSheetMaterialPlugin efficiency HOT 1
- Seeking Flexible Sprite Sheet Animation
- Seeking runtime adjustment of AlphaMask threshold
- Please restore AnimatedSpritesFragment to example app
- Stencil Buffer is not initializing corrrectly,
- Some `ScreenQuad` materials spew error messages at frame rate
- Objects starts to render with delay when camera if far from them HOT 1
- How to translate object with touch screen?
- anyway to implement ray in the library?
- Create Sphere with phiStart, phiLength, thetaStart, thetaLength HOT 1
- LoaderFBX.java:347 ArrayIndexOutOfBoundsException
- display obj model in AR
- Examples are broken
- When will the new version be released?
- load obj file fail,NumberFormatException: For input string: "nan"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rajawali.