Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,483 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Scaling a model between two points ... #245072
01/08/09 09:51
01/08/09 09:51
Joined: Apr 2008
Posts: 31
C
Chrisu Offline OP
Newbie
Chrisu  Offline OP
Newbie
C

Joined: Apr 2008
Posts: 31
How can I scale (and position) a model in relation of two other objects in the 3d world? I need that for the "visual management" of the springs and dampers of a car.

Thx in advance.

Re: Scaling a model between two points ... [Re: Chrisu] #245073
01/08/09 09:55
01/08/09 09:55
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Explain more??

Re: Scaling a model between two points ... [Re: Cowabanga] #245075
01/08/09 09:59
01/08/09 09:59
Joined: Apr 2008
Posts: 31
C
Chrisu Offline OP
Newbie
Chrisu  Offline OP
Newbie
C

Joined: Apr 2008
Posts: 31
@cowabanga: I have a 3d-model which is a spring. This I want to position between a wheel of my car and the body of my car dynamically because the distance between is of course varying.

Re: Scaling a model between two points ... [Re: Chrisu] #245078
01/08/09 10:06
01/08/09 10:06
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
vec_for_vertex
vec_set
my.scale_x,y,z

first calculate 2 positions you want your spring to be attached using vec_for_vertex on car.

then vec_set your springs position to lower one.

usin vec_sub, calculate the vector that points from you one point to other. use vec_to_angle. this will give you the angles which you spring should use.

then using ve_length calculate the lenght of thet vector and scale you entity accordingly.


3333333333
Re: Scaling a model between two points ... [Re: Quad] #245080
01/08/09 10:11
01/08/09 10:11
Joined: Apr 2008
Posts: 31
C
Chrisu Offline OP
Newbie
Chrisu  Offline OP
Newbie
C

Joined: Apr 2008
Posts: 31
Sounds logical but also complicated. I was hoping of any functionality in the engine (not physics) that keeps objects connected to others.


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1