#Culling or something? Parts of model disappearing on rotation

15 messages · Page 1 of 1 (latest)

sacred flame
#

Hey all,

Sorry for the second post. I thought I'd solved it but I hadn't.

Essentially I have a 3d object (.gltf) that I'm loading into three.js and upon rotation via .rotation.y the shins are disappearing.

I've traversed the model and set furstumCulled = false

First image is of load in (with barely turning where one foot is still visible) second image is what happens after a full 360 spin, all the shins are gone.

I am very new to three.js and I really have no idea what could be causing this. Does anyone have any ideas?

dusky hamlet
#

looks unrelated to rotation / frustum culling - since the object is within the frustum

#

what's most likely happening is z-fighting between character legs and that semi-transparent green circle

#

consider setting depthTest and depthWrite on that green circle material to false

sacred flame
#

the green circle material is rendered in phaser and independent from the injected three.js, I gave it a go with disabled cones so you can see.

It essentially only clips off the shins at 5π/4 and 7π/4

#

and it clips the feet off before that?

still dune
#

looks like the character is sticking underground a bit.. do you have orbitcontrols hooked up? You should look at it from the side and see if the feet are sticking out below the terrain

sacred flame
#

Not orbitcontrols no, the camera is fixed and the character rotates.

But if the character was sticking underground, wouldn’t it surface again on rotation?

sacred flame
#

It was the fustrum, the near fustrum was off painfull

sacred flame
#

well maybe not

#

wtf

#

it only works with the debuggers on???

    // Add this after setting up the scene
    const helper = new THREE.CameraHelper(camera);
    threeScene.add(helper);

    // Add axes helper to visualize model position
    const axesHelper = new THREE.AxesHelper(5);
    threeScene.add(axesHelper);

and then the debuggers don't render?

#

Yeah this is the most insane thing. I'd be happy to add someone to the repo to try themselves but this is crazy

#

it doesn't even need the axesHelper, just the cameraHelper