J2-2 / MarbleCurves

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Marble Curves

Marble Curves is a Unity package that provides a node based system for creating 3D curves. Included in this document are installation instructions, links to some video tutorials and a user manual.

Installation

To install Marble Curves, on github choose the desired version from the Releases and download the .unitypackage file. Then in Unity go to Assets>Import Package>Custom package then selected the .unitypackage file in the newly extracted files. Now an option for the Marble Curves Window should appear in the Tool tab in Unity.

Video Tutorials

A brief overview of using the nodes and the four curve modes.
https://youtu.be/UWdwOsa5cds

User Manual

Table of Contents

Nodes
Rectangle Mode
Tube Mode
Custom Mode
Fit to Curve Mode UVs Curve Options

Nodes

Nodes are the basic tool used to create the shape for curves. The button Create New Nodes creates a Nodes object in the heirarchy with a number of node object children specified by Number of Nodes. They will spawn in front of the camera in the scene. Wherever the nodes are positioned within the scene the curve will go through them. The curve will also be going in the drection of the node at that point and it's rotation will be determined by the rotation of the node. This means that all kinds of shaped curves can be made by positioning the nodes in different ways.

Nodes

Buttons

Create New Nodes:
Make a new set of nodes with the number to create specified by Number of Nodes.

Load Selected Nodes:
Load the set of nodes that is selected in the heirarchy. You can have either the nodes parent object selected or any of the node objects selected.

Delete Node:
Delete the node from the currently selected set of nodes at the position specified by Position.

Add Node:
Add a node to the currently selected set of nodes at the position specified by Position.

Node Smoothness Values

Node smoothness value is a property of each node that determines how straight the curve will be at that node. The higher the smoothness value the straighter the curve. Here is an example of 3 curves with nodes in the same postion but with different smoothness values.

Smoothness 20 Smoothness 30 Smoothness 50
Node smoothness is 20 for all nodes Node smoothness is 30 for all nodes Node smoothness is 50 for all nodes

The nodes do not have to have the same smoothness value, they can be changed individually to achive a desired curve shape. If just a smooth curve is desired then the Auto-Position Internal Nodes button will change the orientation and node smoothness of each node except for the ones on the end to make it as smooth as possible. This means to make a smooth curve all that needs to be done is to put nodes in the desired postion, orient the first and last nodes and choose desired node smoothness and then Auto-Position Internal Nodes will do the rest.

Buttons

Set All:
Sets the value of each node's node smoothness to the value specified by Smoothness Value.

Auto-Position Internal Nodes:
Sets the orientation and node smoothness of each node except for the first and last one based on their positions and the direction and node smoothess of the first and lasts nodes in a way as to make the curve as smooth as possible.

Rectangle Mode

Ractangle mode can be selected by choosing the rectangle option in the mode selector. This mode makes it so that the cross section of the curve will be a rectangle with dimensions specified by Width and Height. The middle of the curve will be centered on the top edge of the rectangle.

Parameters

Width/Height:
These control the width and height of the cross section of the curve.

Width 8, Height 1 Width 4, Height 4 Width 1, Height 2
Width is 8 and Height is 1 Width is 4 and Height is 4 Width is 1 and Height is 2

Width Offset/Height Offset: These control how offset the cross section is from the center of the curve. When set to 0 and 0 the center of the curve is positioned in the middle of the top edge of the rectangle cross section.

Width Offset 2, Height Offset 0 Width Offset -4, Height Offset 4 Width Offset 0, Height Offset 0.5
Width Offset is 2 and Height Offset is 0 Width Offset is -4 and Height Offset is 4 Width Offset is 0 and Height Offset is 0.5

Length Step Size/Width Step Size:
These control the dimensions of the faces that the curve will be subdivided into. The smaller the size the smoother the geometry will be but the curve will take up more memory and take longer to make. Using larger face sizes can create a jagged edge on the curve.

Length Step 0.5 Length Step 1 Length Step 4
Length Step Size is 0.5 Length Step Size is 1 Length Step Size is 4

Round Tile to Nearest:
This controls how the faces that make up the curve and the uvs are rounded to better fit the curve. For example if there is a curve of length 21.4 when Round Tile to Nearest is set to 0 no rounding will occur so the curve will have 21 tiles plus a last tile of length 0.4 the rest of the tiles. If Round Tile to Nearest is set to 1 then the curve will be rounded to length 21 so it will have 21 tiles. If Round Tile to Nearest is set to 4 then the curve will be rounded to length 20 and have 20 tiles.

Round 0 Round 1 Round 4
Round Tile to Nearest is 0 Round Tile to Nearest is 1 Round Tile to Nearest is 4

Tube Mode

Ractangle mode can be selected by choosing the tube option in the mode selector. This mode makes it so that the cross section of the curve will be a circle with an inner and outer edge specified by Inner Radius and Outer Randius. The middle of the curve will be centered on the middle of the circle.

Parameters

Inner Radius/Outer Radius:
These determine the size and thickness of the circle cross section of the curve. Inner Radius is the distance from the center to the inner edge and Outer Radius is the distance to the outside edge. So the thickness of the circle will be Outer Radius - Inner Radius.

Inner 4, Outer 5 Inner 1, Outer 3 Inner 2, Outer 2.5
Inner Radius is 4 and Outer Radius is 5 Inner Radius is 1 and Outer Radius is 3 Inner Radius is 2 and Outer Radius is 2.5

Width Offset/Height Offset:
These control how offset the cross section is from the center of the curve. When set to 0 and 0 the center of the curve is positioned in the middle of the circle cross section.

Width Offset 2, Height Offset 0 Width Offset -4, Height Offset 4 Width Offset 0, Height Offset 3
Width Offset is 2 and Height Offset is 0 Width Offset is -4 and Height Offset is 4 Width Offset is 0 and Height Offset is 3

Length Step Size:
This controls the length the faces that the curve will be subdivided into. The smaller the size of the length step the smoother the geometry will be but the curve will take up more memory and take longer to make. Using larger face sizes can create a jagged edge on the curve.

Length Step 0.5 Length Step 1 Length Step 4
Length Step Size is 0.5 Length Step Size is 1 Length Step Size is 4

Divisions:
This controls the numbers of faces the circumference of the circle will be made up of. More divisions wil make the curve smoother but take up more memory and take loger to make.

Divisions 32 Divisions 16 Divisions 8
32 Divisions 16 Divisions 8 Divisions

Round Tile to Nearest:
This controls how the faces that make up the curve and the uvs are rounded to better fit the curve. For example if there is a curve of length 21.4 when Round Tile to Nearest is set to 0 no rounding will occur so the curve will have 21 tiles plus a last tile of length 0.4 the rest of the tiles. If Round Tile to Nearest is set to 1 then the curve will be rounded to length 21 so it will have 21 tiles. If Round Tile to Nearest is set to 4 then the curve will be rounded to length 20 and have 20 tiles.

Round 0 Round 1 Round 4
Round Tile to Nearest is 0 Round Tile to Nearest is 1 Round Tile to Nearest is 4

Custom Mode

Custom mode can be selected by choosing the custom option in the mode selector. This mode makes it so that the cross section of the curve will be the shape of the chosen Cross Section. The middle of the curve will be centered on the pivot of the Cross Section object.

Parameters

Cross Section:
This is a GameObject that determines the shape of the cross section of the curve. A GameObject can be chosen by dragging it into the Cross Section box in the Marble Curves window or by selecting it and pressing the Use Selected Button. The selected GameObject must have a 3D mesh to be used. The edges of the faces of object along x = 0 relative to the pivot will be used so make sure that the pivot is in the right location of the object selected. Faces entirely within x = 0 will be used at the start and the end of the curve. UV information from the GameObject will be used, If the UVs on one side are messed up (the face will apear black with the default texture) then make sure the UVs on that face of the the Cross Section GameObject are not rotated. Some examples of diefferent Cross Section gameobjects with pivots visualized and the curves they generate are below.

Custom Cross Section #1 Custom Cross Section #2 Custom Cross Section #3

Width Offset/Height Offset:
These control how offset the cross section is from the center of the curve. When set to 0 and 0 the center of the curve is positioned on the pivot of the selected Cross Section GameObject.

Width Offset 6, Height Offset 0 Width Offset -4, Height Offset 4 Width Offset 0, Height Offset -1
Width Offset is 6 and Height Offset is 0 Width Offset is -4 and Height Offset is 4 Width Offset is 0 and Height Offset is -1

Length Step Size:
This controls the length the faces that the curve will be subdivided into. The smaller the size of the length step the smoother the geometry will be but the curve will take up more memory and take longer to make. Using larger face sizes can create a jagged edge on the curve.

Length Step 0.5 Length Step 1 Length Step 4
Length Step Size is 0.5 Length Step Size is 1 Length Step Size is 4

Round Tile to Nearest:
This controls how the faces that make up the curve and the uvs are rounded to better fit the curve. For example if there is a curve of length 21.4 when Round Tile to Nearest is set to 0 no rounding will occur so the curve will have 21 tiles plus a last tile of length 0.4 the rest of the tiles. If Round Tile to Nearest is set to 1 then the curve will be rounded to length 21 so it will have 21 tiles. If Round Tile to Nearest is set to 4 then the curve will be rounded to length 20 and have 20 tiles.

Round 0 Round 1 Round 4
Round Tile to Nearest is 0 Round Tile to Nearest is 1 Round Tile to Nearest is 4

Fit to Curve Mode

Custom mode can be selected by choosing the fit to curve option in the mode selector. This mode makes it so that the curve will be a copy of shape of the chosen Object to Fit That is deformed so that it fits along the curve. The middle of the curve will be centered on the pivot of the Object to Fit object.

Parameters

Object to Fit:
This is a GameObject that will be copied and deformed so that it fits along the curve. A GameObject can be chosen by dragging it into the Object to Fit box in the Marble Curves window or by selecting it and pressing the Use Selected Button. The length along the x-axis will be the length along the curve. The object begin at x = 0 realtive to it's pivot and should be shorter than the length of the curve. If the object is longer than the length of the curve the Stretch to Fit Curve option can be selected so that it will be compressed to fit in the curves length. Below is an object with pivot visaulized and the result of fitting it to a curve.

Fit Curve

Offset:
This controls how many units away from the start of the curve the object will be fit too. When Offset is 0 the pivot of the object will be at the start of the curve.

Offset 0 Offset 5 Offset 10
Offset is 0 Offset is 5 Offset is 10

Width Offset/Height Offset:
These control how offset the cross section is from the center of the curve. When set to 0 and 0 the center of the curve is positioned on the pivot of the selected Object to Fit GameObject.

Width Offset 4, Height Offset 0 Width Offset -4, Height Offset 4 Width Offset 0, Height Offset 1
Width Offset is 4 and Height Offset is 0 Width Offset is -4 and Height Offset is 4 Width Offset is 0 and Height Offset is 1

Stretch to Fit Curve:
This option wether the length of the object is stretched or compressed so that it is the same length of the curve or wether it keeps its original length.

Stretch to Fit Curve Off Stretch to Fit Curve On
Stretch to Fit Curve Off Stretch to Fit Curve On

UVs

There are options for setting how the UVs for the curve should look. Different Modes have different numbers of options for UVs because some modes take UVs from an input object also.

Parameters

Scale:
This controls the size that the texture will appear on the curve. Scale < 1 will make the texture bigger and scale > 1 will make the texture smaller. When in rectangle mode length scale controls the scaling along the length of the curve, width scaling controls the scaling along the top of the rectangle, and height scaling controls the scaling along the side of the rectangle. When in tube mode length scale controls the scaling along the length of the curve, width scale controls the scale along the circumference of the circle, and height scale controls the scale along the thickness of the circle. When in custom mode the only option availible is length scale which controls the scaling along the length of the curve because the other UVs are taken from the Cross Section GameObject. When in fit to curve mode all UVs are taken from the Fit to Curve GameObject.

Length Scale 0.5 Length Scale 1 Length Scale 2
Length Scale is 0.5 Length Scale is 1 Length Scale is 2

Offset:
This controls what what hpw far along the texture will begin. When in rectangle mode length offset controls the offset along the length of the curve, width offset controls the offset along the top of the rectangle, and height scaling controls the offset along the side of the rectangle. When in tube mode length offset controls the scaling along the length of the curve, width offset controls the offset along the circumference of the circle, and height offset controls the offset along the thickness of the circle. When in custom mode the only option availible is length offset which controls the scaling along the length of the curve because the other UVs are taken from the Cross Section GameObject. When in fit to curve mode all UVs are taken from the Fit to Curve GameObject.

Length Offset -0.25 Length Offset 0 Length Offset 0.25
Length Offset is -0.25 Length Offset is 0 Length Offset is 0.25

Curve Options

Some additional options for how the curve should appear.

Parameters

Angle Interpolation:
This controls how the orientation of the curve is interpolated between nodes. With linear interpolation the angle of the platform between two nodes will be interpolated linearly. With smooth interpolation The angle of the platform between two nodes will be disproportionately close to the node that it is closer to.

Linear Smooth
Linear Interpolation Smooth Interpolation

Include Faces:
This determines which sides of the curve are included in the curve. These only apply in rectangle and tube mode. Top and Bottom are the top and bottom sides of the rectangle cross section or the inner and outer circumference of the circle. Left and Right are the left and right sides of the rectangle and don't apply in tube mode. Start and End are the faces at the beginning and end of the curve.

Buttons

Make Curve:
This button creates the curve object based on the currently selected nodes and the parameters selected.

Credits

Made By J2_2

Special Thanks to Hyran for his help testing

About

License:MIT License


Languages

Language:C# 100.0%