Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Syncing UI Spline and Regular 3D Spline
#3
(03-12-2019, 12:00 PM)_Aka_ Wrote: Hi,

1- Splines' control points coordinates are in the local space of the spline. So by using the same local position, and changing the spline's transform, you can have synchronized splines with different scales, rotations and positions. I attached a scene and script doing this. In my script I synchronize only the the control point's positions. I assume that both your splines have already the right setup (the same interpolation type for example), and that you don't modify the handles. If that assumption is false, you can easily add to my script the code that will synchronize the needed properties.

2- You will need to write the code for a simplified runtime editor. I bet there are on the store some assets that already do that. Control points being GameObjects, anything on the store that allows you to move game objects at runtime will do the trick here.

3- Yes, you can have multiple meshes with multiple materials on the same spline. I added to the attached scene a "TubeSetuper" that does that with two materials. You can then enhance that script to handle whatever number of tubes you need.

Keep in mind that both the scripts are just proof of concept, so they are definitely not be the most optimized and error resilient scripts you can get.

Let me know if you still have any other question
Have a nice day

Hi,

Thankyou so much for providing a sample as well. It was very helpful.

Is there a way I can control the sections of the UI spline in a particular way?

For example, as you can see in the previous attached image, the UI spline section needs to be in a particular shape.

The blue initial section of line representing distance "D1" should be straight at all times and angle should be 90 degrees no matter how the length would be changed.

The next section that is the red curve should be governed by the angle "θ". θ will start from line "r1" and extend till a particular angle, which will govern the length of the red curve till point D3. 

The last blue section should be straight at all times and it's length will depend on the value of "XT" found by equations and the red curve, together.

I know my question is a bit complex, but basically is there any way to govern the angle and length of a curve using an angle? And secondly how do I keep the blue curve section straight at all times and only let their lengths be altered at run time?


Reply


Messages In This Thread
RE: Syncing UI Spline and Regular 3D Spline - by arrnav96 - 03-13-2019, 08:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 14 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: