|
3 registered members (AndrewAMD, Grant, Neb),
908
guests, and 6
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Rotating an Entity
#261336
04/17/09 00:08
04/17/09 00:08
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
Hello, As I've tried several things with Vec_for_vertex, however, it doesn't do what I want to do! I want to let an entity rotate around its own axis or how you want to call it. Here is a sample movie, made within SketchUp, but I need to get the same in 3DGS: http://www.youtube.com/watch?v=6803YrCNwNYAs you can see, the main platform aswell as the 4 satelites rotate while being tilted! How to archief this within 3DGS?
Last edited by Dreher; 04/17/09 00:09.
A7 7.77
|
|
|
Re: Rotating an Entity
[Re: Dreher]
#261337
04/17/09 00:15
04/17/09 00:15
|
Joined: Oct 2007
Posts: 5,209 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
|
why not just make it one model?
if you want to place them by code, one vec_for_vertex wont be enough, you also have to calculate the vector from center of to the position and use that for pan. for tilt you either use the main platforms tilt or calculate it with a c_scan.
3333333333
|
|
|
Re: Rotating an Entity
[Re: Quad]
#261338
04/17/09 00:20
04/17/09 00:20
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
I can't make it one model as I have several moving parts on it, it's all done by physics aswell ^^ I'll see what I can do, I have no experience with calculations though EDIT: And when I use my.tilt = 7; it rotates around the world axis with 7 degrees, and it should rotate with 7 degrees like on the movie  EDIT2: It's all rotating already, all objects are placed aswell, I just need the parts I got on my model not be rotating horizontally, but with 7 deg off, and as 'my.tilt = 7;' isn't working the way I need it to be working, I'm lost ^^ EDIT3: I just noticed, that it does work with just 'my.tilt = 7;' when there ain't no physics used, but as soon as there are physics, it just doesn't want to rotate with 7 deg properly. I've also tried to disable physics first, then make it tilt by 7, then enable again, but that doesn't do the trick in this case either!
Last edited by Dreher; 04/17/09 00:56.
A7 7.77
|
|
|
Re: Rotating an Entity
[Re: Dreher]
#261342
04/17/09 01:08
04/17/09 01:08
|
Joined: Oct 2007
Posts: 5,209 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
|
take a look at ang_rotate, this roates entity on its own axises regardless to it's world orientation.
ang_rotate(my.pan,vetor(0,7,0));// rotate entity on it's on axises
3333333333
|
|
|
Re: Rotating an Entity
[Re: Quad]
#261344
04/17/09 01:17
04/17/09 01:17
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
Yep, it does, but it doesn't like that when I use physics^^ So I guess that ain't an option either  EDIT: tried it to be sure, but it doesn't even rotate when using physics, only when I disable physics ><
Last edited by Dreher; 04/17/09 01:21.
A7 7.77
|
|
|
Re: Rotating an Entity
[Re: Widi]
#261398
04/17/09 12:53
04/17/09 12:53
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
.. I already use that to rotate something, but it rotates horizontally, and when I put in: my.tilt = 7; it rotates with 7 degrees on the world axis, not its own axis or how you want to call it.
I won't get the same result as seen in the video I posted.
Last edited by Dreher; 04/17/09 12:54.
A7 7.77
|
|
|
Re: Rotating an Entity
[Re: Dreher]
#261401
04/17/09 13:10
04/17/09 13:10
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Im an extreme noob with physics, but try "phent_addtorquelocal( entity, vector(rotation_speed*time_step,0,0) );" after, of course, the entity has been set to entity.tilt=7;
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Rotating an Entity
[Re: EvilSOB]
#261405
04/17/09 13:33
04/17/09 13:33
|
Joined: Apr 2009
Posts: 113 Netherlands
Dreher
OP
Warez Victim
|
OP
Warez Victim
Joined: Apr 2009
Posts: 113
Netherlands
|
Great! This got the job done for the main platform, however, the 6 satelites that rotate on the main platform, go back to 0 tilt after like 20 seconds, but thats a step in the right way! Thanks alot though! 
A7 7.77
|
|
|
Re: Rotating an Entity
[Re: Dreher]
#261422
04/17/09 14:38
04/17/09 14:38
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Have you got the satellites to stay "in-place" on the main platform with physics yet? I cant help with that part, dont know how to use any physics constraints yet. But if I can see your physics code that keeps the satellites in place, I should be able to see what needs doing to rotate them properly.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|