Obsttorte 1556 Posted December 20, 2012 Report Share Posted December 20, 2012 (edited) If you only apply the translation any normalization of the normal vector is unnecessary as it won't change anyways.You're obviously more familiar with the maths than I am, so if you can suggest an improved implementation that gives the correct result with less error we can certainly try using it instead of the old code.Well, I study maths. For the implementation something like Plane3 Matrix4::transform(Plane3 plane) { Plane3 transformed; transformed.normal().x() = plane.normal().x(); transformed.normal().y() = plane.normal().y(); transformed.normal().z() = plane.normal().z(); transformed.dist() = plane.dist() - ( m[12]*transformed.normal().x() + m[13]*transformed.normal().y() + m[14]*transformed.normal().z() ); return transformed; } This code is correct if the func_static only gets translated. Edited December 20, 2012 by Obsttorte 2 Quote FM's: Builder Roads, Old Habits, Old Habits Rebuild Mapping and Scripting: Apples and Peaches Sculptris Models and Tutorials: Obsttortes Models My wiki articles: Obstipedia Texture Blending in DR: DR ASE Blend Exporter Link to post Share on other sites
OrbWeaver 662 Posted December 20, 2012 Report Share Posted December 20, 2012 What code is executed when we hit the Save button? I haven't analysed the call sequence up to the level of actual UI operations, but the high-level class for writing the map seems to be MapExporter (radiant/map/algorithm/MapExporter.cpp). Its prepareScene() and finishScene() methods are what calls the code to add and subtract the origins — if you put a breakpoint here you should get a stack trace all the way up to the UI. I believe the same exporter class is used in several places to implement Save, Save As, Export Selected etc. Quote DarkRadiant homepage ⋄ DarkRadiant user guide ⋄ OrbWeaver's Dark Ambients ⋄ Blender export scripts Link to post Share on other sites
Obsttorte 1556 Posted December 20, 2012 Report Share Posted December 20, 2012 If you want to add a new function that does the trick you don't need this matrix stuff there. It should be enough to pass the translation vector (that is the func_static's origin) to it as an extra argument. Quote FM's: Builder Roads, Old Habits, Old Habits Rebuild Mapping and Scripting: Apples and Peaches Sculptris Models and Tutorials: Obsttortes Models My wiki articles: Obstipedia Texture Blending in DR: DR ASE Blend Exporter Link to post Share on other sites
grayman 2982 Posted December 20, 2012 Author Report Share Posted December 20, 2012 I have to complete my work on another problem, then I'll be away for a week, during which I can read/answer email, but nothing more. After I get back, if this problem is still unsolved, I'll examine the math and see if there's anything I can contribute. Good luck and thanks for working on this. Quote Link to post Share on other sites
Bikerdude 3742 Posted December 21, 2012 Report Share Posted December 21, 2012 +1 on what Gman said, I too appreciate this being looked at. Quote Link to post Share on other sites
OrbWeaver 662 Posted December 21, 2012 Report Share Posted December 21, 2012 I implemented the translation-only code, which stopped changes to the normal vector but there were still progressive errors in the distance value. Switching to the maths provided by Obsttorte seems to fix this problem, presumably because it is not using unsafe tiny values as intermediates in the calculation. The current behaviour with brushTest1.map is that there is a change between the original map and the first saved version, but multiple load and save cycles after that do not result in progressive changes. Further testing will be required to determine if this is sufficient. 3 Quote DarkRadiant homepage ⋄ DarkRadiant user guide ⋄ OrbWeaver's Dark Ambients ⋄ Blender export scripts Link to post Share on other sites
Obsttorte 1556 Posted December 21, 2012 Report Share Posted December 21, 2012 Yippie \o/ Quote FM's: Builder Roads, Old Habits, Old Habits Rebuild Mapping and Scripting: Apples and Peaches Sculptris Models and Tutorials: Obsttortes Models My wiki articles: Obstipedia Texture Blending in DR: DR ASE Blend Exporter Link to post Share on other sites
grayman 2982 Posted December 21, 2012 Author Report Share Posted December 21, 2012 Woo-hoo! All mappers will join together on the town commons, raise a statue in your likeness, sing and dance, and raise a glass in your name! Quote Link to post Share on other sites
Tels 279 Posted December 21, 2012 Report Share Posted December 21, 2012 And buy Obstorte a beer Quote "The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950) "Remember: If the game lets you do it, it's not cheating." -- Xarax Link to post Share on other sites
Obsttorte 1556 Posted December 21, 2012 Report Share Posted December 21, 2012 I prefer whisky Quote FM's: Builder Roads, Old Habits, Old Habits Rebuild Mapping and Scripting: Apples and Peaches Sculptris Models and Tutorials: Obsttortes Models My wiki articles: Obstipedia Texture Blending in DR: DR ASE Blend Exporter Link to post Share on other sites
Sotha 1909 Posted December 21, 2012 Report Share Posted December 21, 2012 Fantastic! Getting this fixed is the best christmas present any mapper could ever wish for! Quote Clipper-The mapper's best friend. Link to post Share on other sites
demagogue 1276 Posted December 22, 2012 Report Share Posted December 22, 2012 Definitely. It was fun to watch you guys crack this nut.Cheers all around and especially Obsttorte the taffer of the hour & Orbweaver.Think I may celebrate with some complex func_statics. Quote What do you see when you turn out the light? I can't tell you but I know that it's mine. Link to post Share on other sites
i30817 24 Posted December 22, 2012 Report Share Posted December 22, 2012 Isn't it strange that i's moving on save? Quote Link to post Share on other sites
Obsttorte 1556 Posted December 22, 2012 Report Share Posted December 22, 2012 (edited) This is a problem caused by the conversion. EDIT: The right formula was posted by Tels first. I only explained why the original code wasn'T so good. Edited December 22, 2012 by Obsttorte Quote FM's: Builder Roads, Old Habits, Old Habits Rebuild Mapping and Scripting: Apples and Peaches Sculptris Models and Tutorials: Obsttortes Models My wiki articles: Obstipedia Texture Blending in DR: DR ASE Blend Exporter Link to post Share on other sites
nbohr1more 2237 Posted December 24, 2012 Report Share Posted December 24, 2012 So... will this get rolled-out as as DR 1.7.3 ? or another 1.8 alpha build? Also, would reverting Func_statics to World_Spawn on map load and only making items func_staticbefore the final save act as a workaround? I am a little concerned about how much challenge this problem will pose to the contest participants. At least they can use DR 1.5.1 though it is much slower... Quote Please visit TDM's IndieDB site and help promote the mod: http://www.indiedb.com/mods/the-dark-mod (Yeah, shameless promotion... but traffic is traffic folks...) Link to post Share on other sites
grayman 2982 Posted December 24, 2012 Author Report Share Posted December 24, 2012 can't change func_statics to worldspawn automatically because many of them have entity spawnargs that would get lost in the process Quote Link to post Share on other sites
Sotha 1909 Posted December 24, 2012 Report Share Posted December 24, 2012 .Ase exporting as a model is a suitable workaround at the moment. Quote Clipper-The mapper's best friend. Link to post Share on other sites
Obsttorte 1556 Posted December 25, 2012 Report Share Posted December 25, 2012 (edited) Further testing will be required to determine if this is sufficient.Just asking: Has this been taking place? Is the problem solved? Edited December 25, 2012 by Obsttorte Quote FM's: Builder Roads, Old Habits, Old Habits Rebuild Mapping and Scripting: Apples and Peaches Sculptris Models and Tutorials: Obsttortes Models My wiki articles: Obstipedia Texture Blending in DR: DR ASE Blend Exporter Link to post Share on other sites
grayman 2982 Posted December 28, 2012 Author Report Share Posted December 28, 2012 Back from va-ca. Status? Quote Link to post Share on other sites
OrbWeaver 662 Posted December 28, 2012 Report Share Posted December 28, 2012 Status? This is the current status (in Git): The current behaviour with brushTest1.map is that there is a change between the original map and the first saved version, but multiple load and save cycles after that do not result in progressive changes. I assume you will want to do your own testing based on the problem as you have experienced it. If this seems to be OK, then we should make a beta build for mappers to test in the wild and ensure that the fix really is complete. Quote DarkRadiant homepage ⋄ DarkRadiant user guide ⋄ OrbWeaver's Dark Ambients ⋄ Blender export scripts Link to post Share on other sites
grayman 2982 Posted December 28, 2012 Author Report Share Posted December 28, 2012 Thanks. I'll pull the latest from the repository and build something to test with. l8r Quote Link to post Share on other sites
grayman 2982 Posted December 28, 2012 Author Report Share Posted December 28, 2012 I can't figure out how to update my copy of the Git repository so it's the latest. I don't see any "update" request, which is what I would use in SVN. ?? Quote Link to post Share on other sites
grayman 2982 Posted December 28, 2012 Author Report Share Posted December 28, 2012 On second thought, it would probably be best if you make a beta version available so folks other than me can test simultaneously. Different people using it different ways on different func_statics might observe different things. And I'm not doing much mapping atm anyway, because I'm trying to wrap up the fix to a TDM bug. Thanks. Quote Link to post Share on other sites
OrbWeaver 662 Posted December 28, 2012 Report Share Posted December 28, 2012 I can't figure out how to update my copy of the Git repository so it's the latest. I don't see any "update" request, which is what I would use in SVN. The corresponding function in Git is "git pull" from the command line or an equivalently-named option in the GUI. On second thought, it would probably be best if you make a beta version available so folks other than me can test simultaneously. That makes sense. My Windows build environment should hopefully still be functional so I will make a beta build and upload it to the DR website for testing. Quote DarkRadiant homepage ⋄ DarkRadiant user guide ⋄ OrbWeaver's Dark Ambients ⋄ Blender export scripts Link to post Share on other sites
demagogue 1276 Posted December 29, 2012 Report Share Posted December 29, 2012 Interestingly there was an article on the philosophy of GitHub & why things are "pulled" in the NYTimes today. Quote What do you see when you turn out the light? I can't tell you but I know that it's mine. Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.