|
Gamecode
|
 |
« on: July 19, 2008, 11:51:19 AM » |
|
hi... i have in my game menu, and in menu is one window, and in this windows is rotating model .... but : i have models diferent size ... first model is ok in this window, second (bigger model) is too big and is out of this windows (model is bigger than this window)
and i need get model size , and from this size rescale complete model to size like model one.
|
|
|
|
|
Logged
|
aiR Captains - RC aircraft project TV65
|
|
|
WEst
Community Member

Posts: 803
Daniel Martinek
|
 |
« Reply #1 on: July 19, 2008, 11:58:29 AM » |
|
Use GetBoundingBox to get the maximum width, lenght and height of the model, then use the biggest of the three and compare it to your first models biggest value (or to a fixed one) and use the relation of the two to get a scale value. Something like ValueOfFirstModel / ValueOfSecondModel will give you a value to scale the second model accordingly.
|
|
|
|
|
Logged
|
Greetings
Daniel Martinek Lead Programmer Roaming Nova Studios
|
|
|
|
Gamecode
|
 |
« Reply #2 on: July 19, 2008, 12:19:06 PM » |
|
Dim a As TV_3DVECTOR Dim b As TV_3DVECTOR
letadlo.GetBoundingBox a, b
MsgBox a.X MsgBox a.Y MsgBox a.z
MsgBox b.X MsgBox b.Y MsgBox b.z max height is a.x + b.x ?
|
|
|
|
|
Logged
|
aiR Captains - RC aircraft project TV65
|
|
|
|
Gamecode
|
 |
« Reply #3 on: July 19, 2008, 12:20:59 PM » |
|
i have : Abs(a.X) + Abs(b.X)
thanx WEst
|
|
|
|
|
Logged
|
aiR Captains - RC aircraft project TV65
|
|
|
WEst
Community Member

Posts: 803
Daniel Martinek
|
 |
« Reply #4 on: July 19, 2008, 01:01:48 PM » |
|
I think it should be b.x-a.x as the second parameter is always bigger than the first.
|
|
|
|
|
Logged
|
Greetings
Daniel Martinek Lead Programmer Roaming Nova Studios
|
|
|
|
Gamecode
|
 |
« Reply #5 on: July 19, 2008, 03:25:01 PM » |
|
daniel martinek , nejsi nahodou z cech ? sory for czech language
|
|
|
|
|
Logged
|
aiR Captains - RC aircraft project TV65
|
|
|
WEst
Community Member

Posts: 803
Daniel Martinek
|
 |
« Reply #6 on: July 19, 2008, 03:30:55 PM » |
|
Sorry, no czech here  , I'm through and through austrian, although the names origin is in czech I can't find any czech relation in my family the last 100 years 
|
|
|
|
|
Logged
|
Greetings
Daniel Martinek Lead Programmer Roaming Nova Studios
|
|
|
|
Gamecode
|
 |
« Reply #7 on: July 19, 2008, 03:39:17 PM » |
|
hmmm , name is realy very czech 
|
|
|
|
|
Logged
|
aiR Captains - RC aircraft project TV65
|
|
|
jviper
Community Member

Posts: 1308
Discipline in training
|
 |
« Reply #8 on: July 19, 2008, 04:47:05 PM » |
|
To use the bounding box, you need to transform it to your viewport's camera matrix because getting the width and height. An easier option would be to use a boundingsphere instead, and place your camera that distance away.
|
|
|
|
|
Logged
|
JAbstract.....Don't just imagine, make it happen!
|
|
|
|
Gamecode
|
 |
« Reply #9 on: July 20, 2008, 04:02:03 AM » |
|
To use the bounding box, you need to transform it to your viewport's camera matrix because getting the width and height. An easier option would be to use a boundingsphere instead, and place your camera that distance away.
hmm its true ! but i use now box, and all is ok....
|
|
|
|
|
Logged
|
aiR Captains - RC aircraft project TV65
|
|
|
|