Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,582 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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,211
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,211
İ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 | 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