Page 1 of 1

Bug?: Absolute mode for ScaleEntity() for Cylinder does not work

Posted: Tue Apr 27, 2021 11:04 am
by Psychophanta
Bug?: Absolute mode for ScaleEntity() for Cylinder does not work?
Test yourself:

Code: Select all

InitEngine3D()
InitSprite():InitKeyboard():InitMouse()
OpenWindow(0,0,0,800,600,"tip",#PB_Window_BorderLess|#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0),0,0,800,600,0,0,0,#PB_Screen_WaitSynchronization)
Add3DArchive(#PB_Compiler_Home+"examples/3D/Data/Textures",#PB_3DArchive_FileSystem)

CreateLight(0,$EEEEEE,4,4,2,#PB_Light_Point)
CreateCamera(0,0,0,100,100)
MoveCamera(0,0,0,6,#PB_Absolute)
LoadTexture(0,"soil_wall.jpg")
CreateMaterial(0,TextureID(0))
CreateCylinder(0,0.1,2)
CreateEntity(0,MeshID(0),MaterialID(0),-1,0,0)
CreateEntity(1,MeshID(0),MaterialID(0),1,0,0)

Repeat
  ExamineKeyboard()
  WindowEvent()
  If KeyboardReleased(#PB_Key_Right)
    ScaleEntity(1,1,1,1,#PB_Absolute)
  EndIf
  RenderWorld()
  FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)

Re: Bug?: Absolute mode for ScaleEntity() for Cylinder does not work

Posted: Tue Apr 27, 2021 12:17 pm
by pf shadoko
sclae fonction multiply the dimensions
if you multiply by 1, there is no difereence
try with :
ScaleEntity(1,1,2,1,#PB_Absolute)

Re: Bug?: Absolute mode for ScaleEntity() for Cylinder does not work

Posted: Tue Apr 27, 2021 5:34 pm
by Psychophanta
pf shadoko wrote: Tue Apr 27, 2021 12:17 pm sclae fonction multiply the dimensions
if you multiply by 1, there is no difereence
try with :
ScaleEntity(1,1,2,1,#PB_Absolute)
I wrote ScaleEntity(1,1,1,1,#PB_Absolute) on purpose, because manual says:
#PB_Absolute: absolute scale, in world unit.

Re: Bug?: Absolute mode for ScaleEntity() for Cylinder does not work

Posted: Wed Apr 28, 2021 4:30 pm
by Comtois
ScaleEntity(0,x,y,z,#PB_Relative)

Scales the entity, combining it's current scale with the passed in scaling factor.
@remarks
This method applies an extra scaling factor To the entity's existing scale, (unlike ScaleEntity(0,x,y,z,#PB_Absolute) which overwrites it) combining it's current scale with the new one.

Re: Bug?: Absolute mode for ScaleEntity() for Cylinder does not work

Posted: Wed Apr 28, 2021 5:35 pm
by pf shadoko
"in world unit" : it doesn't make sense
(should be removed from the doc)

Re: Bug?: Absolute mode for ScaleEntity() for Cylinder does not work

Posted: Wed Apr 28, 2021 6:39 pm
by Psychophanta
pf shadoko wrote: Wed Apr 28, 2021 5:35 pm "in world unit" : it doesn't make sense
(should be removed from the doc)
Dear pf shadoko,
At least I miss some critical thing, it has all the sense, and I am not able to understand your position this time. :shock:

Manual:
#PB_Relative: relative scale, based on the previous size (default). Using 1.0 for scale value will let this value unchanged.
#PB_Absolute: absolute scale, in world unit.

Re: Bug?: Absolute mode for ScaleEntity() for Cylinder does not work

Posted: Wed Apr 28, 2021 11:14 pm
by pf shadoko
I will complete the explanations of comtois:

for example if you have a sphere of radius 5

relative scale of 2 -> radius =2*5 = 10
relative scale of 3 -> radius =3*10 = 30
relative scale of 5 -> radius =5*30 = 150

absolute scale of 2 -> radius =2*5 = 10
absolute scale of 3 -> radius =3*5 = 15
absolute scale of 5 -> radius =5*5 = 25

the relative scale multiplies the current dimension of the entity
the absolute scale multiplies the initial dimension of the entity

Re: Bug?: Absolute mode for ScaleEntity() for Cylinder does not work

Posted: Fri Apr 30, 2021 8:53 am
by Psychophanta
pf shadoko wrote: Wed Apr 28, 2021 11:14 pm the absolute scale multiplies the initial dimension of the entity
So, That IS NOT the meaning of the word "absolute". Please respect semantic at least a minimum.

:o