devNote 8-21-16 A Unifying Framework

 

 

Screenshot_152.8889_

Screenshot_158.8333_

Screenshot_151.3000_

 

sdfgdfg

 

Select Events with Rotary Buttons

2: Toggle Paint New Hex intersections

3. Line Draw

4. Equi Distant Note Points


FOR SteamVR - Launch App - Don't Prime

13fghfdgf17

https://www.reddit.com/r/Vive/comments/4eu3uh/how_to_revive_your_nonworking_vive_tips_and_tricks/

13fghfgh610917

Drawing Lines

gfhjgfhj1

In this tutorial we will focus on the very basics. We will create a smooth path between a series of empty GameObjects. And if we want to create a connected path so it can form a loop, we will also be able to do that. So what you first have to do after you have created a new scene in Unity is to create an empty GameObject. As children to that GameObject, you should create more empty GameObjects. Name these something like p1, p2, p3,… because they will form our path. Remember to create at least 4 of them, because that is the minimum number of so-called control points in a Catmull-Rom spline. Then create a new script called CatmullRomSpline. Add the following code in the beginning.

Step 1 is to just display the control points. We will do that in a method called OnDrawGizmos(). That method will update continuously even though we haven’t pressed the play button. Also drag the path you created (p1, p2, p3,…) to your list (click on the GameObject to which you attached the script and drag the points to the “Control Points List”). If you go to the Unity editor, you should now see spheres at the same positions as the control points.

Now we will add the Catmull-Rom spline. If you have 4 control points called p0 p1 p2 p3, you will be able to add a smooth path between the 2 middle points (p1 and p2) and not all 4. To do that, we will use all 4 points, and then move from p1 to p2 with a distance (or resolution) called t. t will always be between 0 and 1, where 0 is exactly at the same coordinate as p1 and 1 is exactly at the same coordinate as p2. It might sound complicated, but I believe this is the best explanation: Introduction to Catmull-Rom Splines.

The coordinate of a vector in 3d space at distance t between p1 and p2 is given by the following method. So add it!

To be able to use ReturnCatmullRom() we have to add the following to OnDrawGizmos(). It will basically iterate through the control points and see if we should generate a Catmull-Rom spline from the current control point to the next, and if we want a path that loops.

 

That wasn’t too difficult? If you go to the editor you should be able to do this:

Catmull-Rom splines finished

 

In the specific Catmull-Rom form, the tangent vector at intermediate points is determined by the locations of neighboring control points. Thus, to create a C1 continuous spline through multiple points, it is sufficient to supply the set of control points and the tangent vectors at the first and last control point. I think the standard behavior is to use P1 – P0 for the tangent vector at P0 and PN – PN-1 at PN.

According to the Wikipedia article, to calculate the tangent at control point Pn, you use this equation:

T(n) = (P(n – 1) + P(n + 1)) / 2
This also answers your first question. For a set of 4 control points, P1, P2, P3, P4, interpolating values between P2 and P3 requires information form all 4 control points. P2 and P3 themselves define the endpoints through which the interpolating segment must pass. P1 and P3 determine the tangent vector the interpolating segment will have at point P2. P4 and P2 determine the tangent vector the segment will have at point P3. The tangent vectors at control points P2 and P3 influence the shape of the interpolating segment between them.

hgklhgkl-7

USE Splines

pop