ArcBall Camera Android - java

I'm trying to create an arcball camera for use in my 3D Android game (note: I am using the libGDX framework)... I am having trouble figuring out how to go about creating it. I can probably extend the current PerspectiveCamera class in libGDX and add some logic to handle the arcball rotations around a sphere, but I need an explanation about how it works. I am still learning OpenGL ES but I think I'm at a good point to attempt this.

I found your question and this (stackoverflow) answer while looking for the same thing myself.
I haven't tried the code out myself yet, so I can't confirm whether it works or not.
I'm going to need something similar myself for my game idea, just wanted to make sure I've got everything I need ;-) .
Let us know if this does the job.
Cheers

Related

Blur A Circle In Java

I am writing a game in Java but have run in to an issue. I need to blur certain entitities within the game in order to create the right look. However, a lot of these objects are circular and so I am having issues blurring them properly.
Here is an example of the kind of thing I'm aiming for:
Currently, I'm using a box blur but just can't think of a way to achieve this sort of effect.
If somebody could give me a nudge in the direction I need to be looking that would be great.
Thanks.
Will

Slingshot in box2d and libgdx

How can I achieve something like this?
https://www.youtube.com/watch?v=qnpkd3Ucg7s
I know it should be done with a MouseJoint. The only problem is that I don't know how to "pin" the MouseJoint to the starting point. Everthing else I will manage to solve.
Is very easy to create a mouse joint, check up this youtube tutorial:
http://www.youtube.com/watch?v=dF5dUiJtYng
And check up the source for the video you provided
http://appcodingeasy.com/Gideros-Mobile/Gideros--Box2d-Slingshot

Flat infinate line?

I know that this is probably a very, very basic question but I'm very new. Basically I want to create a platform that my character can walk on. Almost like in the game "Flappy Bird" but, I want it to be a walkable platform. Is there any way I can create a "line" that stretches out infinitely. I've seen this, but it's for iOS and isn't a flat line. I've tried researching, but I haven't seen anything that appeals to what I'm looking to achieve. Any help would be great. As a heads up I'm using libGDX Also leading me to any tutorials for something similar would be equally appreciated.
There is a tutorial to create an exact copy of flappy bird
http://www.kilobolt.com/zombie-bird-tutorial-flappy-bird-remake.html
Could you modify this to create your walkable game?

How to show only part of map on screen

I'm developer of game Space STG II for Android phones... and I want to add to this game new option. To do this I need to know how to do movable screen. I want to do a battle like in Heroes Might & Magic, but in mobile phone screen is small... I don't know how developers show only a part on screen of all things on map. I want to make a small map in corner which show which part of map is shown on screen.
I can't find it :/ I spend 2 days and I found only 2d tile moving, but I need smooth moves. Please help. I will give activation codes for Space STG II for help.
This question is rather vague, and so in return I can't reply with more than a vague answer. Adding this new feature to your game is very specific to how you wrote your game to begin with. If you used bad coding habits, it's going to be very difficult. From what I gather, you are trying to add a mini-map in the corner like many games have. If your model of the game and view are intertwined, you're going to have issues doing this. If you used a design pattern like Model-View-Controller http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller it would be easier to add another "view" of your model and implement it as the minimap. Sorry for the vague answer, but I don't have much else to work with seeing as you have a specific question with not many details of how your game is written.
If you're writing OpenGL code, its extremely easy- just draw the scene and move the camera to look at whatever location you want. Scrolling means moving the camera and will be smooth. Note that a tile approach works fine with OpenGL
If you're using some other 2D API, it might not be that simple. You could try to look up algorithms yourself for how people implement scrolling in widgets (think- how do people make a listview?). You'll come up with something.
Edit: If you do accept this answer, I don't really want your activation codes. Thanks anyway.

Do I need to use OpenGL in my 2D Java sim game?

I have recently been developing a sim game in java, as many of my questions show, and it's come a long way! Graphically, it is somewhat lacking, and at current I'm using shapes for items, people, rooms etc.
I was looking at other similar projects, and noticed that one was using OpenGL. I have been reading CokeAndCode "space invaders 103 - refactoring and OpenGL", and I still don't know if it is something I need in my game or not.
Here is a video that I used for a previous question, but it still shows basically what I have so far (http://www.screenjelly.com/watch/Bd7d7pObyFo), although I have done a lot of refactoring and re coding over the last few weeks, but graphically, nothing has changed. As I understand it, I'm currently using java2D to do this.
I really don't know how I should continue graphically with this game. This is my first project I have done outside of learning for my own enjoyment, and so I'm still rather new to this.
Thanks in advance!
This could turn into a long subjective conversation quickly but I want to state the fact that you don't need openGL. Your application doesn't need to be the best looking one out there. Nethack still attracts people and between you and me : the graphics sucks.
Do you want to learn about 2D and 3D graphics and textures and so on ? Then try stuff... best way to learn. Then you can add this to your resume.
There are a lot of tutorial to do your first steps in OpenGL or some other graphic library. You can even try Qt Jambi. But once you start, you're in for a ride ;)
According to this, it's still largely possible to implement a working graphical game in Java2D with decent performance, as long as you make sure not to do a certain number of bad things.
It might help you to check and see how your approach is, compared to this.
I have no idea how far along Java has come with OpenGL support, so were I in your place I would probably just see how much refactoring of the Java2D code I could do, and figure out what to do from there.
Hope this helps, at least a bit.
One good side of using opengl (even for 2D graphics) is that you will get (if properly done) hardware graphics acceleration for your scenes.
Also, you can use orthogonal projection and keep one of the axis (Z) as zero to do your 2D graphics. It will be easy if you want to add a 3D effect (like lightning or something) if you use OpenGL.
However it all depends on how much you want to improve the graphics, since adding OpenGL might make things a little more complicated than plain Java2D.
How to continue graphically: use textures, more interesting animations (implement a simple physics engine and/or collision detection, that always looks nice).
When you go 3d (for example using opengl) you can add lighting effects to the equation, that usually does a lot to the aesthetics of the whole. For example if the moving circle was a sphere with a nice texture (marble or something), then you could make it really role over the board, and you could specify diffuse and specular reflection values to vary the lighting like for example here.
Camera movement can also beef up the graphics.

Categories