Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One Float shows as Int, while others show and update correctly #9

Open
GoogleCodeExporter opened this issue Jun 10, 2015 · 15 comments
Open

Comments

@GoogleCodeExporter
Copy link

See http://hotblocks.nl/tests/three/dat.gui.html

As you can see by the animation, the Camera's rotation and position are 
changed. Of the 6 variables seen in the dat GUI, only the Camera's height isn't 
changed every 1/60 second.

The rotation is in rad, so is very precise and obviously a float. Two of those 
floats work as expected: as floats. If you click the document, the animation 
will stop. You can then change the rotation variables. Two of those can be 
changed to floats.

For some reason, the first will never be a float. Not if it's fetched from the 
live animation. Not when you set it manually. Not ever.

Internally, it's definitely a float though.

What's going on? I've defined the 6 variables indentically: range [-5, 5] step 
0.1

Original issue reported on code.google.com by rudiedirkx on 22 Jan 2012 at 3:41

@GoogleCodeExporter
Copy link
Author

I'm getting a 404 on this page

Original comment by georgebr...@google.com on 27 Feb 2012 at 3:49

@GoogleCodeExporter
Copy link
Author

It existed a month ago. And now it does again.

Original comment by rudiedirkx on 27 Feb 2012 at 5:43

@GoogleCodeExporter
Copy link
Author

I also found the same problem, however, I believe the issue is simply that the 
initial value is negative.

Doing simple tests with an object with 2 number properties and setting one to 
1.5 and the other to -1.5 shows the dat.GUI of the 2nd negative property as in 
integer, while the first positive number as a float with 1 decimal place.

Here is a demonstration:
http://jsfiddle.net/c2SJA/

Original comment by ma...@happyworm.com on 4 May 2012 at 1:47

@GoogleCodeExporter
Copy link
Author

I'm getting this with all non-positive values, which is quite frustrating when 
using it to position objects starting at an origin.

Original comment by co...@colinroache.com on 9 Jan 2013 at 7:19

@GoogleCodeExporter
Copy link
Author

Yeah, this still exists. Or at least in the version I downloaded a few days 
ago. Weird. 

Original comment by rudiedirkx on 9 Jan 2013 at 7:05

@GoogleCodeExporter
Copy link
Author

This is a quick fix that I am currently using

Original comment by co...@colinroache.com on 12 Jan 2013 at 2:41

Attachments:

@GoogleCodeExporter
Copy link
Author

* 1/10 is not good enough IMO and
* could you roll that into a GIT patch?

The strange thing to me (but I must admit, I've been drinking one or two this 
evening) is that for 2 of 3 variables ir works perfectly and for 1 it doesn't. 
Same context applies: http://hotblocks.nl/tests/three/dat.gui.html Camera . 
Rotation . x & y work perfectly like floats and z doesn't.

I must admint I haveb;t chcked the actuyal code, but it seems odd to me. Does 
your fix actually fix that?

Original comment by rudiedirkx on 12 Jan 2013 at 2:58

@GoogleCodeExporter
Copy link
Author

Has anyone looked into this? I'm seeing this issue too.

It really appears that dat.gui development is dead. Is this the case? 

Original comment by bsenft...@gmail.com on 3 Sep 2013 at 11:26

@GoogleCodeExporter
Copy link
Author

This looks related to https://code.google.com/p/dat-gui/issues/detail?id=31. 
You should be able to set the precision with step(). I just tried the fix 
suggested on that link and it works for me. Will see if I can get a patch 
together.

Original comment by aaron.b...@gmail.com on 7 Dec 2013 at 6:54

@GoogleCodeExporter
Copy link
Author

In patch form against the dat.gui repo, the fix from issue #31 is below. If you 
just want to fix your local build, apply the two-line addition to 
build/dat.gui.js as appropriate.

diff --git a/src/dat/controllers/NumberController.js 
b/src/dat/controllers/NumberController.js
index a589bf4..294e36c 100644
--- a/src/dat/controllers/NumberController.js
+++ b/src/dat/controllers/NumberController.js
@@ -122,6 +122,8 @@ define([
          */
         step: function(v) {
           this.__step = v;
+          this.__impliedStep = v;
+          this.__precision = numDecimals(v);
           return this;
         }


Original comment by aaron.b...@gmail.com on 7 Dec 2013 at 7:12

@GoogleCodeExporter
Copy link
Author

Good news, it's back on github at https://github.com/dataarts/dat.gui

jonobr1 (@jonobr1) tweeted at 7:01 PM on Wed, Dec 18, 2013:
@airburst sorry for the delay. Github and Google Code are now mirrors and all 
issues and Pull Requests will be redirected to Github.

Original comment by aaron.b...@gmail.com on 19 Dec 2013 at 1:38

@GoogleCodeExporter
Copy link
Author

Pull request at https://github.com/dataarts/dat.gui/pull/31

Original comment by aaron.b...@gmail.com on 19 Dec 2013 at 1:55

@GoogleCodeExporter
Copy link
Author

Now accepted and applied to codebase. Won't appear in the main js file until 
they build. 
https://github.com/dataarts/dat.gui/commit/1cb6eca274eae229915f386b7798ea19cf2a0
217

Original comment by aaron.b...@gmail.com on 19 Dec 2013 at 2:21

@GoogleCodeExporter
Copy link
Author

This is taking a while to resolve...

Original comment by an...@rehabstudio.com on 24 Sep 2014 at 3:55

@GoogleCodeExporter
Copy link
Author

I am using the latest build 
https://github.com/dataarts/dat.gui/releases/tag/v0.5.1, that has the suggested 
bug fix 
https://github.com/dataarts/dat.gui/commit/1cb6eca274eae229915f386b7798ea19cf2a0
217 , still I am facing the same issue.

I am having 5 float value sliders and always the second one shows abnormal 
behaviour. Unfortunately, I cannot provide a link to the page since I am 
developing on localhost.

Has anyone been able to solve it?

Original comment by mishra.r...@gmail.com on 4 Jun 2015 at 10:48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant