Android LibGDX Particle System is fixed on screen - java

I have a 3D scene that runs on libGDX(Android). I want to use particle system. When I create one using the tutorials/examples found online (e.g. Particle System libGDX) I get a particle system which works fine. Except for one thing: it is fixed on screen.
When I move the camera around the particle system stays on the same place on screen (like a fixed HUD element or so). Maybe it's because of Sprite-nature of ParticleEffect.
The other issue related is that the ParticleEffect.setPosition() method takes values not in the World coordinates but in screen pixels. Is this correct? I can calculate new on-screen coordinates in pixels and update ParticleEffect position every frame. But that seems like a hack to me.
Is there a more "right" way to make my particle system behave like other objects in my 3D scene and not be fixed on screen?

The Particle System is just working in 2D System. It's not a 3D Particle System thats why you wont get it into your world. That's why it's inside of the g2d package (graphics 2D). Thats also the reason why it just take 2D cords and not 3D cords.
Also the Feature list says that it's inside of the 2D Highlevel API.
Featurelist

Related

JavaFX 3D Constant width 3D Line

I'm currently creating a 3D solar system model and need to create trails behind the orbits of the bodies.
I have been using Cylinders to create a 3D line, however I would like to produce a line that stays at a constant width no matter the zoom of the view.
I think it might be possible with a 2D line but im not sure how to go about that, I would need to convert the 3D Points into the 2D Points for the scene and then create a line using them, but the line would need to be continually updated depending on the rotation and zoom of the camera.
Is there a better way to go about this?

How to use particle effects like mentioned?

I am developing a multi-platform game on android studio using libGDX library and java language.
The game requires the player to maneuver a main ship across 2D space using mouse input.
I am using the given ParticleEffect class in libGDX library to show its exhaust but there is a slight problem that looks like this...
This is the standing ship
and
This is when its moving upward
I need every particle to move only downwards respective to the ship regardless the ship is standing or moving.
This means that I need to add the change in (x,y) coordinates of ship into each particle of exhaust but the problem is that the (x,y) coordinates of that class are private and there is no function that lets me make any direct changes to the coordinates of individual particles.
How do I make that happen?
Not sure, if I understood the question right. But probably, you can solve your issue via marking the emitter as attached. In this case if you change draw coordinates of ParticleEffect from (x0,y0) to (x1,y1), then every particle, which is already emitted, will be moved by (x1-x0, y1-y0) as well.
See the screenshot:

Libgdx create sky / environment in 3D

I am developing a 3D game using the Libgx 3D api. Now i want to add some environment (not the Libgdx Environment, but a real environment), like the sky or some background. I have heard about the so called skybox, and i understood, more or less, how it works.
This "skybox" is a Box arround your Gameworld. So you are inside this box. You add a Texture to all 6 faces at the inside of this box. Now you set your camera to the center of this box, but with the right view direction, and start the rendering, so you have always the same distance to the faces, but you can rotate arround at look at other faces. Then you set your camera where you really are in the world and render all the models, objects, whatever. Did i understand that right?
I could not find a tutorial on how to do that with libgdx. So my question is: How do i create a "skybox" in libgdx, how do i add my Textures to it and how do i render it as background/environment? Or are there other, maybe easier possibilities?
You can use big sphere which is textured inside around your world. If use blender, just create sphere object and unwrap this mesh. Then flip normals to see texture inside the sphere.
Another way is to create cubemap as you described above. I have made a class which works with cubemap. Just follow this link: LibGDX 0.9.9 - Apply cubemap in environment

2D Moving Camera (LWJGL)

I'm currently developing a 2D RPG with LWJGL, and am still in the engine stage of development. I've got a lot of the tech I want created, but one of my big problems is fixing the camera on the player. All the solutions I've seen involve moving the world and keeping the player still, which can work, but it seems apparent that this can cause some calculation issues if not closely monitored. Normally, I'd write a system where I wouldn't have to worry about it, but I refuse, because I eventually intend on adding multiplayer capability, where a moving world would be unplayable.
Is there a way to affix the camera to an object or point that can move WITHOUT using translate to move the world around? Also, I'd like to avoid Slick if possible. That would require me to rework much of my game engine as it currently stands.
Whenever you are going to project the 3d viewport onto a 2d screen you need to move everything according to the point of view of the observer (the so called camera or view).
I guess you can't escape from this. What you usually do is having a Camera object which holds position and rotation that is used to build the view matrix which is passed to the vertices of your scene through a uniform to the shaders. Passing transformation matrices to shaders is the normality so you shouldn't feel burdened by it. You can always premultiply it with the perspective matrix.
You must move the whole world to match the position of your camera just because you need to transform everything in your scene as it is seen from that point of view, otherwise how could you then project it on your screen? There is no "move the camera, keep the world still" concept.
Move the world visually, it's how every other RPG does it. Don't move the actual world's location though.
Draw everything but the ui normally, than translate it all according to the players position (i.e. glTranslate2f(-player.x,-player.y)). This is all done in the render method. On networked multiplayer, the viewport is done to that specific player (i.e. Bob's screen is translated based off Bob's position, Jane's is translated based off Jane's position). Should you instead want single-screen multiplayer, you will probably have to use mutliple framebuffers (one per player), and use them as viewports.

How to move pictures in a radial movement?

I'm trying to build a food menu that the first things users will see on the screen monitor are rotating images of twelve different dishes. I imagine trying to use threads and a timer that will rotate the objects in a circle via changing coordinates or layout managers.
However, 3d rotational movements are encouraged to which I have no real experience in. I've also heard that you can use a java applet and let javascript rotate the objects. I welcome any recommendations and thank you for reading.
If you don't want to go the whole Java 3D or OpenGL route, you can get a 2½ D effect by using AffineTransform and varying x, y and the apparent size. There's an example here.

Categories

Resources