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 - mbowen89

Pages: [1]
Support / Smoke and dirt
« on: December 28, 2012, 06:17:44 pm »
Ok, I know this has been somewhat discussed before, but I'm really really wanting to figure this out.

I know that a "particle" system would be the easiest and most simple approach, and the only one discussed, but I have no idea how to generate the smoke I specifically need in that manner. I need thick black exhaust smoke, and LOTS of it!


I've used a particle system before trying this, but it just looks pretty cartoony with puffs of smoke coming up, and I used hundreds.

Any ideas? And any ideas about making dirt from the tires spinning come out?


Support / Rotations, I hate em! Help, please :)
« on: November 27, 2012, 03:18:57 am »
Ok, I have created my little smoke particle creator code, it's working decent enough... basically while the vehicle is at origin I set the smoke (a texture on x number of planes) to come out of where the exhaust is on top of tractor, works great. I can make it move with the tractor in a straight line easy enough, but getting it to rotate as the tractor rotates is the hard part... To make the tractor drive in the direction of its rotated angle, here is my code:

Code: [Select]
move_vector = vehicle.getXAxis();
move_vector.x = move_vector.x * delta_x;
move_vector.y = 0;
move_vector.z = move_vector.z * delta_x;

The wheels and tractor are imported together but are two objects. The tractors pivot point is the wheels original pivot point. (Does this pivot point translate as the wheels move by the way?)
Code: [Select]
for(int ii=1; ii<max_smoke; ii++) {

That moves the smoke well enough that it's moving down the track with the tractor, however it's not being rotated to stay right over the exhaust pipe of tractor. I simply rotate the tractor with rotateY when I am rotating. With not changing the smokes pivot point, it just rotates around its own center of course, which doesnt help. Setting it's pivot point to the wheels makes it go crazy even when not trying to rotate it... so I am at a lost as to how to keep it right over the exhaust.

I wish there was a way to set something to the relative coordinates of the object, and not global world. There's not an easy way to do something like that is there? To always set it's position to be at a certain position on the tractor?

Thanks for any help! :)

Support / Overlapping overlays, using!?
« on: November 20, 2012, 04:51:44 pm »
Ok, so I have tried to read up on everything I could do with this, and tried a lot of stuff but can't seem to nail this... please help.

Basically I want to create some gauges as a HUD, so for example an RPM gauge.

I made it in GIMP as a 128x128 square for example, with transparent background. I made the round gauge centered, and I also made a needle centered on transparent background, check these two images out:


So if I make two overlays, both at 0,0... they overlap perfectly, I can rotate the needle overlap to correlate with RPM, awesome. BUT, I get a black background of a square instead of transparency... ok so I do rpm_gauge.setTransparency(100); for example, and the black goes away and is transparent. I do the same for needle. BUT when I set the transparency on the main gauge, the needle also disappears with it. Here is the code that does that:

Code: [Select]
                                TextureManager.getInstance().addTexture("rpm_gauge", new Texture(getResources().openRawResource(R.raw.rpm_gauge_128), true));
rpm_gauge = new Overlay(world, 0, 0, 128, 128, "rpm_gauge");
TextureManager.getInstance().addTexture("rpm_gauge_needle", new Texture(getResources().openRawResource(R.raw.rpm_gauge_needle_128), true));
rpm_gauge_needle = new Overlay(world, 0, 0, 128, 128, "rpm_gauge_needle");

If I comment out: rpm_gauge.setTransparency(255);, the needle reappears but the gauge has black for transparent areas. I've tried using different transparency values for both, changed depth, etc... am I doing something wrong?



Ok, so I reversed the order in which I create the overlays (needle first), and of course it works now... somewhat. The needle likes to flicker quite a bit, and disappeared one time as well until I made it rotate by increasing RPM again. I'm actually doing this with a boost and speed gauge as well. Hopefully I can get a better working solution? Thanks :)

Pages: [1]