aleGutierrezMarin / jiglibflash

Automatically exported from code.google.com/p/jiglibflash
1 stars 0 forks source link

physics.createTerrain is mirrored for away3d meshes #17

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. compile Away3DTerrainTest.as using a non-symmetrical heightmap1.jpg
2. try moving around: 
3. notice that physics response doesn't match the rendered terrain

Hello,
I love Jiglib, thank you so much for all your hard work. Not sure how to get in 
touch with the team but the email was listed on the front page of the 
jiglibflash.com website is broken. I’ve discovered a bug in the terrain class 
for away3d meshes: the physics representation is rotated 90 degrees and 
mirrored compared to the away3d mesh. The one example file does not show this 
since the heightmap image is symmetrical, so the bug was never detected. I’ve 
been bashing my head against this for three days and sadly I’m just not the 
coder you are so I thought I’d send a desperate plea to you to ask that you 
check it out.

Perhaps the solution will be super easy. Something along the lines of the loop 
iterating pixels in the wrong order, or an xy coordinate is negative when it 
should be positive.

To reproduce this bug, compile Away3DTerrainTest.as but use a heightmap image 
that isn’t symmetrical (ATTACHED FOR YOUR CONVENIENCE) – for example put a 
mountain in one corner. Then run your compiled away3d flash file you will see 
the terrain is rendered correctly but the physics response acts as if the hill 
is invisibly situated on the opposite corner. Gosh it sounds so easy to fix, 
and I spent several hours trying, but I have failed. I suppose I could simply 
make two heightmaps, one to send to jiglib and the other mirrored and rotated 
in photoshop to use for the away3d mesh on screen. But to do so I’ll have to 
rip apart the physics.createTerrain class.

I figured that perhaps you are so much more intimately familiar with the engine 
that the fix will present itself to you in mere seconds. I’m being 
optimistic, but I figure, might as well try simply asking, right?

*YOU ROCK! * Thank you so very much. Keep up the wonderful work and if I can 
help in any way let me know.
Kind regards,
Chris K – aka McFunkypants

Original issue reported on code.google.com by breakdan...@gmail.com on 15 Dec 2010 at 7:42

Attachments:

GoogleCodeExporter commented 8 years ago
thanks for report this, I will test it.

Original comment by muzerly on 16 Dec 2010 at 12:50

GoogleCodeExporter commented 8 years ago
Hi, I have fixed this issue.

Original comment by muzerly on 16 Dec 2010 at 3:03

GoogleCodeExporter commented 8 years ago
Dear Muzerly,

Thank you so very much!  I am truly grateful and I have a deep respect and 
admiration for your efforts.  I consider this an early Christmas present, and I 
hope to someday return the favour.  I will svn update my libs now and am very 
excited to continue with my project.  You should be able to play the finished 
game in the near future on my blog, which is http://www.mcfunkypants.com as 
this code is being used for this weekend's Ludum Dare game jam.  

Again, thank you very much.  Your hard work is appreciated and has made a big 
difference to me and others.

Have a wonderful holiday.

Chris K – aka McFunkypants

Original comment by breakdan...@gmail.com on 16 Dec 2010 at 4:24

GoogleCodeExporter commented 8 years ago
Merry Christmas!

Thanks to the terrain mesh bug fix, I used away3d to create a downhill toboggan 
ride: 

http://www.mcfunkypants.com/2010/snowboggan/ 

I'm using a heightmap bitmap to generate a terrain mesh and Jiglib physics 
engine + the Flare particle system.  Written as a pure as3 project using the 
wonderful FlashDevelop.  Check it out!  Be sure to 
smash all the snowmen for extra points.  You can click the restart button on 
the top left if you get flipped over.  I would love to receive your comments.  
Enjoy! =D 

Thanks again!

- Chris K aka McFunkypants 

P.S.  I warmly welcome you to connect with me on twitter: 
http://twitter.com/McFunkypants

Original comment by breakdan...@gmail.com on 24 Dec 2010 at 7:49