- Home /
spiral path generation in unity
i am doing one project in unity. and i want to make path which should be automatically generate in spiral view . first of all i will provide the initial point and also ending point and finally based these point it should be able to generate the path in 3D view.
please anyone help me as soon as possible thanks in advance ........
What do you mean by "path" and what is a "spiral view?" Are you talking about an array of Vector3s or are you talking about something on a terrain?
actually i want to generate the path in 3D .it may be whatever terrain or Vector3s it's not matter. actually i am developing a car racing game . and in this game i want to generate the random path in 3d view . one thing more please tell me the answer with code . because i am beginner . thanks to all in advance
The best methods are given by Graham in your other question : http://answers.unity3d.com/questions/422346/how-to-generate-the-path-or-road-in-unity-3d.html
Honestly this is not the type of project you should be doing if you are just starting out. Your project requires an understanding of many different things : random, vectors, instantiating vs pooling, arrays, colliders, etc etc. You should really start with something small, then work up. The algorythm for provide the initial point and also ending point and finally based these point it should be able to generate the path in 3D view is going to be complex ....
ok i got this . mean i will go step by step . but i have one more problem . problem is that i want to draw a spiral equation in 2d view . how can i draw this spiral. please help me out as soon as possible . thanks a lot in advance .....
Answer by sparkzbarca · Mar 23, 2013 at 09:00 AM
use rotateAround rotate around the center point
as you approach 1/2 pi radians
slerp from where you are to RotateAround result + (postion - point)
you rotate around a point while slowly increasing your distance from the object
the result will be a spiral pattern as long as you control for the speed at which you slerp
hello my friend sparkzbarca can u tell me the code whatever u explain right now . problem is that i am new in unity . and i am not able to write the code for it . so please help me out .thanks in advance...
this isn't about being new to unity this is about knowing how to code. Do you know a program$$anonymous$$g language?
you can rotate around with
transform.RotateAround(point,axis,angle)
you can slerp with vector3.slerp(start,end,time.deltatime)
i can write it it's not that hard but if you cant program there isnt much point. You cant program a game if you cant program
Your answer
Follow this Question
Related Questions
Cloud recognition in Vuforia 0 Answers
About the object disappeared, and computing 0 Answers
Use WII Balance to control GUI 0 Answers
Terrain Procedural Texturing based on height? 4 Answers
How can I show loading process during load resources? 1 Answer