Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411588 Posts in 69386 Topics- by 58443 Members - Latest Member: Mansreign

May 06, 2024, 02:48:52 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Unity 3D HELP PLZ...
Pages: [1]
Print
Author Topic: Unity 3D HELP PLZ...  (Read 4240 times)
Sigma
Level 1
*


View Profile WWW
« on: November 12, 2009, 03:22:33 AM »

Hi Guys,
   I have just started working on Unity 3D. I didn't find any good tutorials to start unity.
The unity website has only 6 video tutors very basic and further they have some sample projects and pdf to explain those sample projects but they are not clear and good. It seems like those pdf are just explaining how to link or add stuffs but they didnt explain what is there in the scripts. So if anyone have idea about unity tutors; POST THE LINK...
Logged

bateleur
Level 10
*****



View Profile
« Reply #1 on: November 12, 2009, 04:29:06 AM »

You might want to start with the Unity Forums for questions like that?
Logged

Sigma
Level 1
*


View Profile WWW
« Reply #2 on: November 12, 2009, 04:43:42 AM »

I just need a gud kick start basically, something that should cover very important basic stuffs in areas of physics, Particles, GUI, Camera......and remaining i will explore.
Logged

nihilocrat
Level 10
*****


Full of stars.


View Profile WWW
« Reply #3 on: November 12, 2009, 07:24:07 AM »

Read the scripts provided with the tutorials, and look at the Unity community wiki. The Unity forums are of course also very useful.

Generally, just fool around with things and scour the scripting reference, just like learning any other library / engine.
Logged

dr.crow
Level 1
*



View Profile
« Reply #4 on: November 16, 2009, 06:27:18 AM »

The 3d platform tutorial seems pretty good.

Just read a couple of pages, though.
Logged
Sigma
Level 1
*


View Profile WWW
« Reply #5 on: November 16, 2009, 12:30:54 PM »

I went through the 3d platform tutor. It helps to understand the interface and how to organize stuffs well. Now I want to know how to rotate a object in unity 3D w.r.t other object through scripting.help with basic quaternion functions value more highly...
Logged

curby
Level 0
**

bacon grills


View Profile WWW
« Reply #6 on: November 16, 2009, 03:15:23 PM »

I couldn't really decipher what your query is about, maybe you could explain a bit more?  But I saw something to do with rotation in there anyway, so this might be relevant?

p.s. Bookmark the unity script reference if you haven't already.
Logged

curby: Twitter

beatnik:  Plain Sight
Sigma
Level 1
*


View Profile WWW
« Reply #7 on: November 16, 2009, 10:08:14 PM »

can anyone give me a basic idea about quaternions and how it differ from euler angles and how to use quaternions to rotate an object?(comparison with euler more preferable Smiley).
Logged

Hayden Scott-Baron
Level 10
*****


also known as 'Dock'


View Profile WWW
« Reply #8 on: November 17, 2009, 12:39:37 AM »

Code:
// Sets the transforms rotation to rotate 30 degrees around the y-axis
transform.rotation = Quaternion.AngleAxis(30, Vector3.up);
transform.rotation = Quaternion.Euler(Vector3.up * 30);
transform.Rotate (Vector3.up * 30);

I don't claim to understand Quaternions in Unity, but ultimately you have to do a little work to pass them angles in degrees.
Logged

twitter: @docky
Alec
Level 10
*****



View Profile WWW
« Reply #9 on: November 17, 2009, 01:06:16 AM »

to rotate 45 degrees around the y axis, you can just use:

transform.eulerAngles.y += 45;
Logged

nihilocrat
Level 10
*****


Full of stars.


View Profile WWW
« Reply #10 on: November 17, 2009, 11:31:27 AM »

Here's how you can turn a rigidbody using quaternions.
Give it a vector where each component represents the amount you want to rotate on that axis, local to the object. So if you wanted to pitch upward slightly while rolling sharply, you would pass "new Vector3(0.0,0.25,1.0)"

Code:
var yaw = 45.0;
var pitch = 45.0;
var roll = 60.0;

function Turn(direction) {
    var xrot = pitch * direction.x * Time.fixedDeltaTime;
    var yrot = yaw * direction.y * Time.fixedDeltaTime;
    var zrot = roll * direction.z * Time.fixedDeltaTime;
    var xQuaternion = Quaternion.AngleAxis (xrot, Vector3.right);
    var yQuaternion = Quaternion.AngleAxis (yrot, Vector3.up);
    var zQuaternion = Quaternion.AngleAxis (zrot, Vector3.forward);

    var totalRotation = xQuaternion * yQuaternion * zQuaternion;

    rigidbody.MoveRotation(rigidbody.rotation * totalRotation);
    // comment the above line and uncomment the below to turn a transform
    //transform.rotation *= totalRotation;
}

You can also slowly turn an object to any given point in 3D space with this:
Code:

function turnTo(direction : Vector3) {
    var destination_rot = Quaternion.LookRotation(direction);
    var str = Mathf.Min (yaw * Time.fixedDeltaTime, 1);

    rigidbody.MoveRotation(Quaternion.Slerp(rigidbody.rotation, destination_rot, str));
    // comment the above line and uncomment the below to turn a transform
    //transform.rotation = Quaternion.Slerp(transform.rotation, destination_rot, str);
}

Of course, this assumes that you want it to determine its turning speed purely through the yaw value, and you want it to take the shortest path there even though it might not look the best for the given object (like you'd probably want an airplane to bank). For some reason I have to turn the yaw value down to about 1.0 for the second function, I think I need to add a bit that will compute str in terms of yaw's value and then clamp that to a 0.0-1.0 range.
Logged

Sigma
Level 1
*


View Profile WWW
« Reply #11 on: November 18, 2009, 09:46:42 PM »

thanx for the reply....
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic