The coordinate value in threejs is too large to be displayed, how to deal with it? - threejs-editor

help me
The coordinate value in threejs is too large to be displayed, how to deal with it?
has 11 digits
don't hesitate to enlighten me

Related

Measuring sizes of before/after images in Photoshop

Perhaps my mind isn't mathematically competent enough to do this, but here it goes:
I am using Photoshop. I have 2 images taken from different heights. Both images have the same object in it (so the size of this object remains the same) but I am trying to resize both images so that this object is the same pixel size. That way I can properly measure the difference between other objects in the images with the proper ratio.
My end goal is to measure the differences of scars healing (before and after) using a same-size object in both images as a baseline.
To measure the difference in the photo, I have been counting pixels using the histogram feature:
Even though i changed the pixel width and height to roughly the same size, the 2 images have a drastically different number of pixels. So comparing the red or white from the before to the after won't make sense until I can get these to match.
Can anyone point me in the right direction here? How can I compare apples to apples here?
So went a different route here in case anyone was trying wondering what I did.
Rather than change the size of the images, just calculated the increase manually separately.

For what should I use the Aspect Ratio NSLayoutConstraint?

When I first started working with AutoLayout, I couldn't find any example which helps understanding for what stands the Aspect Ratio NSLayoutConstraint.
Does someone have an example of usage? Thanks!
I have a demo example of keeping a square view centered in all devices and orientations here.
The constraints are set up in IB, but you could just as easily set them up in code. Most of this was meant to explain how to prioritize margin constraints to let the auto layout engine know what to break and when, but what makes the view square is the aspect ration - it's 1:1. If you want a rectangle, you make it 2:1 (or 1:2 depending).
Once you understand these two pieces (prioritization and aspect ratio), the last piece is the actual margins values - I set them for 10 points, meaning the square will have 10 point margins on the smallest axis. If the device is an iPad Pro 12.9 inch, you get a very large square. If it's an iPhone SE, you get a very small one. No matter what, you get the 10 point margin. Set the margin values up for 50, and the square view is relatively smaller. The important thing is with an aspect ratio of 1:1, it will always be a square.

kinect joint coordinate values change in opposite way

After I place a Kinect 2 and stand in front of it, I moved my arm up in front and down (e.g. forward flexion).
Then, I found my y-coordinate of the wrist joint that changes large (0.17) to small (0.11) and to around (0.16).
I found this strange, because in the Kinect guide, positive y-axis indicates upward direction.
https://msdn.microsoft.com/en-us/library/hh973078.aspx
it seems like we should have larger value of wrist-y coordinate when we place a arm up direction.
I am getting the opposite results. Anyone can comment on this?
Q. Are we supposed to get decreasing y-value of wrist when is moving upward direction?
Q. If not, can anyone have any ideas why this happens?
Q. In addition, I found my the other side of wrist (left) has negative value. Can anyone comment why left side of wrist has negative value?
That happens because of the Kinect v2 reference system. The center of the sensor corresponds to (0,0,0) - x,y,z.
If you make movements to the left or right in the X and Y axis, it is logical to have negative values.
The origin (x=0, y=0, z=0) is located at the center of the IR sensor on Kinect
X grows to the sensor’s left
Y grows up (note that this direction is based on the sensor’s tilt)
Z grows out in the direction the sensor is facing
1 unit = 1 meter
https://msdn.microsoft.com/en-us/library/dn785530.aspx
Hope this helps you.

Special Kind of ScrollView

So I have my game, made with SpriteKit and Obj-C. I want to know a couple things.
1) What is the best way to make scroll-views in SpriteKit?
2) How do I get this special kind of scroll-view to work?
The kind of scroll-view I'd like to use is one that, without prior knowledge, seems like it could be pretty complicated. You're scrolling through the objects in it, and when they get close to the center of the screen, they get larger. When they're being scrolled away from the center of the screen, they get smaller and smaller until, when their limit is met, they stop minimizing. That limitation goes for getting bigger when getting closer to the center of the screen, too.
Also, I should probably note that I have tried a few different solutions for cheap remakes of scroll views, like merely adding the objects to a SKNode and moving the SKNode's position relative to the finger's, and its movement . . . but that is not what I want. Now, if there is no real way to add a scroll-view to my game, this is what I'm asking. Will I simply have to do some sort of formula? Make the images bigger when they get closer to a certain spot, and maybe run that formula each time -touchesMoved is called? If so, what sort of formula would that be? Some complicated Math equation subtracting the node's position from the center of the screen, and sizing it accordingly? Something like that? If that's the case, will you please give me some smart Math formula to do that, and give it to me in code (possibly a full-out function) format?
If ALL else fails, and there is no good way to do this, what would some other way be?
It is possible to use UIScrollViews with your SpriteKit scenes, but there's a bit of a workaround involved there. My recommendation is to take a look at this github project, that is what I based my UIScrollView off of in my own projects. From the looks of it, most of the stuff you'd want has actually been converted to Swift now, rather than Objective-C when I first looked at the project, so I don't know how that'll fare with you.
The project linked above would result in your SKScene being larger than the screen (I assume that is why it would need to be scrolled), so determining what is and is not close to the center of the scene won't be difficult. One thing you can do is use the update loop in SpriteKit to constantly update the size of Sprites (Perhaps just those on-screen) based on their distance from a fixed, known center point. For instance, if you have a screen of width and height 10, then the midpoint would be x,y = 5,5. You could then say that size = 1.0 - (2 * distance_from_midpoint). Given you are at the midpoint, the size will be 1.0 (1.0 - (2 * 0)), the farther away you get, the smaller your scale will be. This is a crude example that does not account for a max or min fixed size, and so you will need to work with it.
Good luck with your project.
Edit:
Alright, I'll go a bit out of my way here and help you out with the equation, although mine still isn't perfect.
Now, this doesn't really give you a minimum scale, but it will give you a maximum one (Basically at the midpoint). This equation here does have some flaws though. For one, you might use this to find the x and y scale of your objects based on their distance from a midpoint. However, you don't really want two different components to your scale. What if your Sprite is right next to the x midpoint, and the x_scale spits out 0.95? Well, that's almost full-sized. But if it is far away from the midpoint on the y axis, and it gives you a y scale of, say 0.20, then you have a problem.
To solve that, I just take the magnitude or hypotenuse of the vector between the current coordinate and the coordinate of the current sprite. That hypotenuse gives me an number that represents the true distance, which eliminates the problem with clashing scale values.
I've made an example of how to calculate this inside Google's Go-Playground, so you can run the code and see what different scales you get based on what coordinate you plug in. Also, the equation used in there is slightly modified, It's basically the same thing as above but without the maxscale - part of the front part of the equation.
Hope this helps out!
Embedding Attempt:
see this code in play.golang.org

Core Plot Charts Axis Position

I'm using core plot 1.0. Currently I'm making the X axis draw say 20 points above the bottom of the screen (so the labels can show up) by defining the Y range a little bit below 0.
Now I was asked that the origin point should be 0.0 and there should not be anything below 0 in both axes, so I'm now looking at the core plot documentation and scratching my head with the following question:
What property do I need to set to move the axes at the position I'd like to and also keep on showing the point labels and axis titles?
Thanks a lot!
I've found it so I leave it here for if somebody else needs help with this.
It is kind of tricky, you need to adjust the xRange and yRange on the plot space so it's big enough to draw the labels, the ticks and the titles and then adjust the visibleRange property on each axis. At this point you get the amount of axis you want and still displaying the information you need.
If someone knows a better way please share :)