3D Scaleing (Help)

Blitz3D Forums/Blitz3D Programming/3D Scaleing (Help)

Christer(Posted 2008) [#1]
How do i scale a mesh so it get smaller. I know that i can use ScaleEntity mesh,1,1,1. If I use 1,1,1 it will be the normal size if I use 0.5,0.5,0.5 it will also be the normal size. If I use -1,-1,-1 then it will dispair. If I use 2,2,2 it will get bigger.
So how do i do?


Naughty Alien(Posted 2008) [#2]
original size is 1,1,1 half size is 0.5,0.5,0.5 soooo , suit yourself on size you want to..and try to use scalemesh instead of scaleentity


Ross C(Posted 2008) [#3]
I prefer to use scaleentity because if you do:

ScaleEntity mesh,0.5,0.5,0.5

then do:

ScaleEntity mesh,1,1,1

it returns to it's orginal size. However, when working with mesh commands, such as modifying the vertices, then you want to work with mesh commands.


blackbag(Posted 2008) [#4]
Christer, so 0.5 does not work?

If you getting your scaling from a variable, then make sure it is a float.


Warner(Posted 2008) [#5]
Perhaps you have parented the camera to the mesh ?


Zethrax(Posted 2008) [#6]
Perhaps you have parented the camera to the mesh ?


Attempting to scale the camera with ScaleMesh would just cause a fatal error, as the camera doesn't have any mesh data. Scaling the camera with ScaleEntity would cause the near and far clipping planes to scale but the size of the mesh would be unaffected.

Like blackbag said, make sure you're using a float variable to store the scale value you wish to apply (assuming you're using a variable in your code).


Riskjockey(Posted 2008) [#7]
Scaling the camera with ScaleEntity would cause the near and far clipping planes to scale but the size of the mesh would be unaffected

True, but if the camera is a child of the mesh, any scaling of the parent entity would also scale the distance between it and the camera. Therefore, the entity that the camera is looking at would not look any different through that camera, even though it is actually smaller.
So Warner's suggestion is valid.