Jump to content

clones instances and LOD


ua4192
 Share

Recommended Posts

Dear all.

Is it possible to use clones and LOD with imported meshes?

With instances I have lots of problems:

1.- When I set a distance and null mesh to be loaded, then the instance is not properly positioned and rotated.

2.- Some instances are not loaded, with the same code the number of intances vary and should not.

3.- The only mesh that seems to work is the null LOD the other meshes with different qualities not.

I can attach the code I am using.

 

Is there any way to use LOD with different quality meshes with clones?

Link to comment
Share on other sites

It seems that the method addLODLevel when used with meshes extracted from method ImportMesh doesn't work properly or maybe the method works in async way like ImportMesh.

This is what I am doing and each time I load the scene, the total number of meshes is different.

First I import all GLTF into my scene but make them not active.

I wait until all meshes have been loaded using a whendone() function on ImportMeshCall. This ImportMeshCall has a countdown and when it reach to zero it means that I have all meshes loaded and saved in an array of meshes.

When I have all meshes loaded and saved in the array, I invoke a function (make_lod_assets) to addLODLevel, by now only one (null when distance is greater than x)

After having finished to add all LODs, I invoke to another function (loadscene) which starts to build the scene.

As I want to keep the same structure than CATIA, I build invisible unitary boxes for all assemblies containing the CATParts (my meshes) and I apply the transformation matrix (rotation+position) in a relative and inherited way. I am using instances because I want to use HW acceleration.

When this function (loadscene) ends it returns the scene and it is rendered.

My meshes (extracted from GLTF) don't have textures

My problem are:

- the addLODLevel seems to work in a async way

-Sometimes the instances are not properly positioned

My code is quite big and not possible to be integrated in PG, but I can attach it.

 

Link to comment
Share on other sites

  • 2 weeks later...

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