Jump to content

Low polygon tree demo (need help)


cartman
 Share

Recommended Posts

Hi guys, loving BabylonJS! Unfortunately i'm stuck at this tutorial: http://www.pixelcodr.com/tutos/trees/game/index.html

The tutorial was written using Babylon 1.13-debug. I tried using Babylon 2.3, and got a really weird tree. It appears that the vertices are somewhat messed up. This was the only change I made.

Any ideas on how to solve this?

Attached the pictures of the rendered trees.

 

babylon2.3.jpg

With Babylon 2.3 (messed up vertices, and somehow there's a gap between the trunk and the leaves)

 

babylon1.3.jpg

With Babylon 1.13-debug. Nice polygons.

Link to comment
Share on other sites

if the code uses some calls to the internal methods VertexData.CreateXXX(), you should take care that, as for BJS2.3, their signatures change from VertexData.CreateXXX(param1, param2, ...) to VertexData.CreateXXX({param1: val1, param2: val2, etc}) 

http://doc.babylonjs.com/classes/2.3/VertexData#static-createsphere-options-rarr-vertexdata-classes-2-3-vertexdata-

https://github.com/BabylonJS/Babylon.js/blob/master/what's%20new.md  ("breaking changes" part)

Link to comment
Share on other sites

4 hours ago, jerome said:

if the code uses some calls to the internal methods VertexData.CreateXXX(), you should take care that, as for BJS2.3, their signatures change from VertexData.CreateXXX(param1, param2, ...) to VertexData.CreateXXX({param1: val1, param2: val2, etc}) 

http://doc.babylonjs.com/classes/2.3/VertexData#static-createsphere-options-rarr-vertexdata-classes-2-3-vertexdata-

https://github.com/BabylonJS/Babylon.js/blob/master/what's%20new.md  ("breaking changes" part)

Thank you! Based on your tip, I use this line

var vertexData = BABYLON.VertexData.CreateSphere({"segments":2,"diameter":sizeBranch}); // compliant with Babylon 2.3

and it works!

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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