Jump to content

Search the Community

Showing results for tags 'spline'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to UNIGINE Forums
    • News & Announcements
    • Getting started
  • Development
    • Content Creation
    • World Design
    • Rendering
    • Animation
    • Physics, Navigation and Path Finding
    • UI Systems
    • Sound & Video
    • Editor
    • C++ Programming
    • C# Programming
    • Networking
    • Sim IG (Image Generator)
    • VR Discussions
    • General
  • Improving UNIGINE
    • Documentation
    • Feedback for UNIGINE team
    • Bug Reports
    • Unigine SDK Beta feedback
  • Community
    • Add-on Store (https://store.unigine.com/)
    • Showcase
    • Collaboration
    • Tools, Plugins, Materials & Tutorials
    • General Discussions
  • Legacy
    • UnigineScript

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 11 results

  1. Road builder

    These components let your create a road and also carve the terrain under it like in Unreal or Unity. spline_tool.zip 1. Import the road tool constructor into your project. 2. Attach BuildRoad.cs to your camera. 3. Press play.0 4. You should see a red dot on your terrain, if not that's mean the ray don't collide with the terrain ( check terrain intersection ). 5. Create your road by clicking on the terrain, F to preview to road, R to delete last point, once you finished the road press G to save it. 6. Close the window, now in the editor, create a new splinegraph, and place it at 0.0.0 position, select the spline you just saved, you can press edit to see it ( there is a view distance limit so you might not see it ) 7. Now it's time to carve the terrain, but it will only work for normalized terrain, and I don't think the normalized button will actually normalize the terrain, so the terrain should be normalized before the import in Unigine. For example, in Gaea, you can export your terrain with normalized option. 8. Create a mesh that will guide the terrain carving: Create a 32x20 plane, intersection should be enabled by default, change intersection mask from 0 to 1, place the node at 0.0.0 position, then drag and drop this mesh into the asset browser to create a .node. 9. Add this node as segment to the WorldSplineGraph ( click and drag the mouse to select all segments at once, push the edit spline button to see segment option ). 9.1 To actually see the road you have to add the LoadGraph.cs component to WorldSplineGraph and press play. WorldSplineGraph sometime take time to load... 9.2 If you still don't see any road your node wasn't positioned at 0.0.0. 10. Deactivate BuildRoad.cs component on your camera, and add CarveTerrain.cs to the WorldSplineGraph. 11. Configure the component, I like to have a resolution of 2k for a 10k terrain, it mean 2k*2k ray will be performed. 11.1 I like to move the SplineGraph down like 1m to have a better carving of the terrain ( position of the splinegraph = 0.0.-1). 12. Now click play and press F to start the process. 13. Close the windows, Create a new terrain with the exact same size and the same height scale ( the created lmap doesn't work yet ). Add the newHeight and the newMask to the terrain. 14. Now you can add your the road node. 15. It look bad ! Yes, because I can only create 8 bit image for terrain heightmap. If you know how to create a 16 bit pixel please help me and the terrain will fit the road perfectly. This is the end, next images won't delete.
  2. Some one Try to work with spline? You have any ideas because one T join is correct and the other no?, I try to change the variant but is correct n2, in the wrong part, not connect, Why?
  3. SplineGraph in C#

    Hey there I have a problem. I want to create a spline via C# so I thought it is a good idea to transfer the sample Spline (C++) into C# but my Spline wont render and I have no idea why because it should show a spline (with the Visualizer). Because when I assign the Script to a NodeDummy or so nothing happens does someone have an idea why? Code: using System; using System.Collections; using System.Collections.Generic; using Unigine; [Component(PropertyGuid = "295cde640e861673976ae9364c0e4f1d868385d8")] public class TestSpline : Component { SplineGraph spline; private void Init() { Unigine.Console.Run("show_messages 1"); //create spline garph spline = new SplineGraph(); //generate spline CreateSpline(spline); } private void Update() { // write here code to be called before updating each render frame RenderSpline(spline); } private void CreateSpline(SplineGraph splineGraph) { splineGraph.AddPoint(Rand(-10.0f, 10.0f)); splineGraph.AddPoint(Rand(-10.0f, 10.0f)); splineGraph.AddPoint(Rand(-10.0f, 10.0f)); splineGraph.AddPoint(Rand(-10.0f, 10.0f)); splineGraph.AddSegment(0, Rand(-10.0f, 10.0f), new vec3(0.0f, 0.0f, 1.0f), 1, Rand(-10.0f, 10.0f), new vec3(0.0f, 0.0f, 1.0f)); splineGraph.AddSegment(1, Rand(-10.0f, 10.0f), new vec3(0.0f, 0.0f, 1.0f), 2, Rand(-10.0f, 10.0f), new vec3(0.0f, 0.0f, 1.0f)); splineGraph.AddSegment(2, Rand(-10.0f, 10.0f), new vec3(0.0f, 0.0f, 1.0f), 3, Rand(-10.0f, 10.0f), new vec3(0.0f, 0.0f, 1.0f)); splineGraph.AddSegment(3, Rand(-10.0f, 10.0f), new vec3(0.0f, 0.0f, 1.0f), 0, Rand(-10.0f, 10.0f), new vec3(0.0f, 0.0f, 1.0f)); } public void RenderSpline(SplineGraph splineGraph) { int num_segments = 50; for (int i = 0; i < splineGraph.NumSegments; i++) { vec3 startpoint = new vec3(splineGraph.GetSegmentStartPoint(i)); vec3 starttangent = new vec3(splineGraph.GetSegmentStartTangent(i)); vec3 endpoint = new vec3(splineGraph.GetSegmentEndPoint(i)); vec3 endtangent = new vec3(splineGraph.GetSegmentEndTangent(i)); Visualizer.RenderVector(startpoint, startpoint + starttangent, new vec4(1.0f, 0.0f, 0.0f, 0.3f), 0.05f); Visualizer.RenderVector(endpoint, endpoint + endtangent, new vec4(1.0f, 0.0f, 0.0f, 0.3f), 0.05f); for (int j = 0; j < num_segments; j++) { vec3 p0 = new vec3(splineGraph.CalcSegmentPoint(i, (float)j / num_segments)); vec3 p1 = new vec3(splineGraph.CalcSegmentPoint(i, (float)j + 1 / num_segments)); Visualizer.RenderLine3D(p0, p1, new vec4(1.0f, 1.0f, 1.0f, 1.0f)); } } } public vec3 Rand(float min, float max) { Random rand = new Random(); vec3 ret = new vec3(); ret.x = (float)rand.Next((int)min, (int)max); ret.y = (float)rand.Next((int)min, (int)max); ret.z = (float)rand.NextDouble(); //returns a number btwn 0.0 and 1.0 return ret; } public void MoveMesh(SplineGraph splineGraph) { float time = Unigine.Engine.TotalTime; //float t = time - Math.Floor((double)(time / spline.NumSegments)) * spline.NumSegments; float t = (float)(time - Math.Floor(time / splineGraph.NumSegments) * splineGraph.NumSegments); int segment_id = (int)t; t -= (float) segment_id; vec3 p = new vec3(splineGraph.CalcSegmentPoint(segment_id, t)); vec3 direction = new vec3(splineGraph.CalcSegmentTangent(segment_id, t)); vec3 up = new vec3(splineGraph.CalcSegmentUpVector(segment_id, t)); //mesh is not implemented still yet //mesh.setWorldPosition(p); //mesh.setWorldDirection(direction, up); } }
  4. Hi, I just observed that SplinePoint class is not available in UnigineScript for 2.7.3 SDK. I didn't check SplineSegment class so please check it too. Variable::setExternClassObject(): can't find class SplinePoint * __ptr64 extern class Disassemble: 0x0000049e: callecfr WorldSplineGraph.createSplinePoint or maybe should I add an additional include ? Cheers, Jan
  5. Hi, I have face an issue with vertex balloon and WorldSplineGraph objects and I need some help. I am generating an SplineGraph with the points where a ship is traveling in order to display the path that has been following for some time. The spline generation part is solved and generates my geometry fine. The problem comes when camera is positioned in high height positions and I need to scale spline geometry to keep this path visible in screen. For this scale I am using geometry inflation but it is failing when my ship is turning (more fail the more inflation is applied). Is there something I am missing? I have attached an example of what I am doing. world_spline_graph_scale.7z Thanks a lot, Javier
  6. Hello, When creating a Spline Object over a landscape as Decal, the material associated with it is created as read-only AND connot be inherited from. This prevents us from changing the Material Mask ID, which is created with the default value of 0xFFFFFFFF. This means the decal will appear on all objects, and not only over the terrain. Suggestions: - make this material inheritable from - add a "Material Mask" entry for Spline Decal in the Landscape editor (this would also be a good idea for all created materials)
  7. I've been struggling to get the scale correct when importing a world transform path. I want to create a path for a character to animate around a race track and it needs to be 100% precise of course. Here's how I'm doing it at the moment. 1 I create a spline path in Max using the same race track .fbx geometry that I use for my environment in Unigine as a guide 2 I animate a box along the spline 3 I export the box via Unigine Path Export (*.PATH) scale: 1.0, from frame 0 to frame 100 4 in Unigine I create world transform path (import .path file) The scale of the imported path is massive. I've tweaked and tweaked the export scale settings but to no avail. it's either a little bit too big or a little bit too small. At the moment I'm exporting the .path file at a scale of 0.01 but it's a little too big. It would be great if I could simply scale the path in Unigine. Any suggestions?
  8. I have a PlayerPersecutor camera linked to animating geometry traveling along a spline. When viewing the animation through the Editor camera the animation runs as smooth as a baby's bum but when viewing through the PlayerPersicutor camera there's terrible jittering going on. Any ideas what the problem could be?
  9. I created an animation with a dummy and a spline in Max 2015 , then I exported with Unigine Export Path . Once placed in the scene makes no animation . If I do the same process in Max2013 and exported as .spline , works perfectly in earlier versions of Unigine . What is the correct process of creation to include a World transform Path in my scene?
  10. This may be off-topic, but is there a method to calculate the coordinates on a spline for a given distance down that spline? I am thinking of describing the movement of a series of objects as splines but I can't seem to figure out a method of getting the coordinates to move the objects to when all I know is the spline and the distance down the spline.
  11. Hello Dear all: Is .spline file a binary file format? Are there any tools to open and edit .spline files? If there is a collection of trajectory data points(such as (x,y,z)),how can we managed to generate a .spline file from these data pointsother then in 3ds max tools? How to export spline and camera path file from 3ds Max,are there any detailed or hand by hand teaching materials for reference?
×
×
  • Create New...