Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subdivision Modifier appears to be not working (?) #10

Open
sdc- opened this issue Sep 7, 2013 · 7 comments
Open

Subdivision Modifier appears to be not working (?) #10

sdc- opened this issue Sep 7, 2013 · 7 comments

Comments

@sdc-
Copy link

sdc- commented Sep 7, 2013

FYI: Last week the subdivision modifier example worked fine.
Now in both Mozilla and Chrome, the examples all look like porcupines - spikes pointing everywhere.

subdivision spikes

@danielribeiro
Copy link

Humm, it seems that this is using Three.js r60, which no longer has face4: mrdoob/three.js#3663

I had a similar issue, but it was obj related: mrdoob/three.js#3835

@stemkoski
Copy link
Owner

Yikes -- I'm going to have to push this example back to Three.js v59 until SubdivisionModifer is fixed...

@sdc-
Copy link
Author

sdc- commented Sep 9, 2013

I'm new to Three.js, but your examples page is really helpful.
I'm working on quite an extensive project, and building on several examples from your page.

For instance, I am working right now on the ability to add new object3D's to a scene that has an existing shape (let's say it's a smooth terrain-like shape), then the new object will 'snap' to the terrain, and as you drag the new object, it will stay on the terrain, as well as rotate to match the face it's currently sitting on.

That's one small part, but there is no example for anything like that out there.

What's fun, is most of the examples I've found online for copying matrices from one object to another don't work anymore because of upgrades to Three.js.

fun.
On Sep 9, 2013, at 6:35 AM, stemkoski [email protected] wrote:

Yikes -- I'm going to have to push this example back to Three.js v59 until SubdivisionModifer is fixed...


Reply to this email directly or view it on GitHub.

@erichlof
Copy link

Hi Professor Stemkoski,

The Topology Data2 example appears broken as well because of this same issue. In the console window it says 'cannot read property 'face' of undefined'. Just wanted to give you a heads-up about that one also.

Thanks so much for the examples - they have really helped me grasp the fundamentals of Three.js!
-Erich

@sdc-
Copy link
Author

sdc- commented Oct 8, 2013

I am using r60 and I have subdivision modifier working. Not sure exactly why yours isn't but I have it up and running, thanks for the example!

@sdc-
Copy link
Author

sdc- commented Oct 8, 2013

I'm using slightly different code, but not much compared with yours...

// CYLINDER

    var faceMaterial = new THREE.MeshBasicMaterial( { color: 0xffffff, vertexColors: THREE.FaceColors } );
    var cylinderGeometry = new THREE.CylinderGeometry(100, 100, 200, 12, 12, false);

            ///
            ///subdivision modifier

            var smooth = cylinderGeometry ;
            smooth.mergeVertices();
            var modifier = new THREE.SubdivisionModifier(1);
            modifier.modify(smooth);

            ///
    ///define different color for each face

        for ( var i = 0; i < cylinderGeometry.faces.length; i++ ) {
        face = cylinderGeometry.faces[ i ]; 
        face.color.setRGB( 0, 0, 0.8 * Math.random() + 0.2 );       
    }

            ///
    var cylinder = new THREE.Mesh( smooth, faceMaterial );
    cylinder.overdraw = true;

    cylinder.name='Cylinder';
    cylinder.position.set(400,100,100);
    scene.add(cylinder);

             //  ( object, size, hex, linewidth )
             //scene.add( new THREE.FaceNormalsHelper( cylinder, 10 ) );

    objects.push(cylinder);

@veleek
Copy link

veleek commented Mar 19, 2016

This is still broken, just wanted to ping this again to find out if there's any known workarounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants