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

Everything related to 3D programming
User avatar
Psychophanta
Addict
Addict
Posts: 4975
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

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

Post 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)
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 285
Joined: Thu Jul 09, 2015 9:07 am

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

Post 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)
User avatar
Psychophanta
Addict
Addict
Posts: 4975
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

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

Post 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.
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
User avatar
Comtois
Addict
Addict
Posts: 1429
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

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

Post 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.
Please correct my english
http://purebasic.developpez.com/
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 285
Joined: Thu Jul 09, 2015 9:07 am

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

Post by pf shadoko »

"in world unit" : it doesn't make sense
(should be removed from the doc)
User avatar
Psychophanta
Addict
Addict
Posts: 4975
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

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

Post 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.
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
User avatar
pf shadoko
Enthusiast
Enthusiast
Posts: 285
Joined: Thu Jul 09, 2015 9:07 am

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

Post 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
User avatar
Psychophanta
Addict
Addict
Posts: 4975
Joined: Wed Jun 11, 2003 9:33 pm
Location: Lípetsk, Russian Federation
Contact:

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

Post 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
http://www.zeitgeistmovie.com

While world=business:world+mafia:Wend
Will never leave this forum until the absolute bugfree PB :mrgreen:
Post Reply