how to flip normals of a imported model?

Ask a Question related to Macromedia Director 3D, Design and Development.

  1. #1

    Default how to flip normals of a imported model?

    i have some models that i have created with cinema4D, the problem is that i
    want to flip the normals of some of these models. to do this i add a meshdeform
    modiefier to the model and try to give every face a new list of vertices.
    these vertices are just the same as before but ordered in this way:
    before: [1,2,3]
    after: [3,2,1]
    this should make the face look into the opposite direction.

    but i do not get this to work,here is the code i that is not working:

    vertlist=themod.meshdeform.mesh[m].face.vertices
    newvertlist=[getAt(vertlist, 3), getAt(vertlist, 2), getAt(vertlist, 1)]
    themod.meshdeform.mesh[m].face.vertices=newvertlist

    if somebody of you knows what to do just tell me. it is very important to do
    this in director and not in the 3D authoring programm!


    hondo3000 Guest

  2. Similar Questions and Discussions

    1. How to get imported model properties
      Hi guys, I'm looking for get heigth/width/length properties for any model imported from 3DSMAX. I saw that i can read this properties from model...
    2. modelsunderray and normals
      in this scene " http://www.kisd.de/~lutz/3dtest/world " i send a ray in the direction of the cameras front. you can navigate with "wasd"keys and...
    3. Putting an imported model under Havok Control
      In the following code: -- gMyWorld is the 3d castmember I'm working with gMyWorld.CloneModelFromCastmember("MyBox", "Box.0",...
    4. Applying a bitmap to an imported model
      Hi, how can I apply a bitmapped texture to an imported 3Dstudio max model. For instance I have a simple model of a character and want to be able...
    5. Model looks flipped when imported in shockwave(Director)
      Hi Sara, I am not 100% sure, but the problem could be the rotation of the model within 3DSMax. First, I would try the "ResetXForm" function in...
  3. #2

    Default Re: how to flip normals of a imported model?

    do you need to call build() after changing the vertex list?
    Ex Malterra Guest

  4. #3

    Default Re: how to flip normals of a imported model?

    Can you achieve what you need by changing the model's visibility property
    (#back, #front, #both) eg theModel.visibility = #back This should give the
    same effect, uless you are using modelsUnderRay, which only works on #front
    faces, regardless of the value of this property IIRC. hth johnAq

    johnAq Guest

  5. #4

    Default Re: how to flip normals of a imported model?

    >
    > vertlist=themod.meshdeform.mesh[m].face.vertices
    > newvertlist=[getAt(vertlist, 3), getAt(vertlist, 2), getAt(vertlist, 1)]
    > themod.meshdeform.mesh[m].face.vertices=newvertlist
    >
    may be something like:

    loop all meshes
    loop all faces

    theFace = theModel.meshDeform.mesh[theMeshNo].face[theFaceNo]
    theNewFace = [theFace[3],theFace[2],theFace[1]]
    theModel.meshDeform.mesh[theMeshNo].face[theFaceNo] = theNewFace

    --???
    --this will not invert the normal in normalList i guess!


    end loop faces
    end loop meshes

    face.vertices are for modelresources as far as I know..



    >
    >
    ::vagt Guest

  6. #5

    Default Re: how to flip normals of a imported model?

    thanks for your ideas,

    i think the problem is that a modelresourc wich type is #fromfile can not be
    changed. i want to flip the normals because i am working at the moment on an
    easy-to-use tool for cinema4D developers. because the w3D file comes out with
    all normals on the wrong side it is impossibil to use rays.

    there is one method that can flip the normals. to make the models usable for
    raycasting you can make them children of the group "world", but this leads to a
    new problem they are mirrored than along the z-axis. but useable with havok and
    raycasting.

    to make them correct working with havok and look like the original you can
    make them child of the group("world") with #perserveWorld. but in this way the
    normals are on the wrong side.

    the only way it would work correct is to model them mirrored in cinema4D to
    have them look correct in shockwave3D and make: c4dmodel.parent=pWorld.

    i have to see what is usefull and what not...

    i tested the scriptexample of "Newsgroup User"

    >theFace = theModel.meshDeform.mesh[theMeshNo].face[theFaceNo]
    >theNewFace = [theFace[3],theFace[2],theFace[1]]
    >theModel.meshDeform.mesh[theMeshNo].face[theFaceNo] = theNewFace
    i tested this script but it is not working. i think its impossible to change
    the propertys of a #fromfile file. i could generate a new mesh, but this would
    add polygones to the scene and even if i delete them after generating new
    meshes it would take a lot of time to do this before the scene starts.

    i am a little bit pissed off because i mailed maxon (company who produces
    cinema4D) and they didnt answered me. maybe because i do not bought the
    programm, i only use it in the design shool and the maxon support only reacts
    on people who have serial numbers...

    since shockwave3D is on the marked nobody deletes the bugs. there are bugs in
    havok, bugs in exporters... and then they wonder why shockwave3D is not
    becomming the leader in the marked of online3D technologies.

    if i find a solution i will put it into this thread.

    hondo3000 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139