Jump to content

How to get property of Object

Ahmet Gürbüz

Recommended Posts

how can i get property of my variables? for example, I would like to get height, diameter value of 

 var cone1 = BABYLON.MeshBuilder.CreateCylinder("cone1", { height: 1, diameter: 0.5, tessellation: 50 }, scene);

I want to use value of height and diameter in following codes.




Link to comment
Share on other sites

Id use a combination of Jerome and Deltas explanations:

var coneOptions = { height: 1, diameter: 0.5, tessellation: 50 };
var cone1 = BABYLON.MeshBuilder.CreateCylinder("cone1", coneOptions, scene);
cone1.options = coneOptions;

the cone1 object can have what ever you want to store on it added after it is implemented.  This is the same for any javascript Object as long as it does not overwrite something it wont ever break anything.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...