Author Topic: Which comes first: setvertexcontroller or build?  (Read 3572 times)

Offline Irony

  • long
  • ***
  • Posts: 151
    • View Profile
Which comes first: setvertexcontroller or build?
« on: November 09, 2014, 03:50:48 pm »
When I setvertexcontroller before build(), there is a warning about normals. When I set vertexcontroller after build, applyvertexcontroller seems to have no effect.
I have read and experienced some contradicting things about the topic.

Maybe it's important to mention that there is a rotateMesh call in there as well.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Which comes first: setvertexcontroller or build?
« Reply #1 on: November 09, 2014, 05:04:43 pm »
The best way is to call calcNormals(), then set the controller, then call build().

Offline Irony

  • long
  • ***
  • Posts: 151
    • View Profile
Re: Which comes first: setvertexcontroller or build?
« Reply #2 on: November 09, 2014, 06:31:35 pm »
Works perfectly, thanks!

Offline Irony

  • long
  • ***
  • Posts: 151
    • View Profile
Re: Which comes first: setvertexcontroller or build?
« Reply #3 on: November 10, 2014, 11:25:01 am »
One related question: Why does a cube have 10 vertices and not 8?

Offline lawless_c

  • int
  • **
  • Posts: 96
    • View Profile
Re: Which comes first: setvertexcontroller or build?
« Reply #4 on: November 10, 2014, 11:55:13 am »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Which comes first: setvertexcontroller or build?
« Reply #5 on: November 10, 2014, 12:30:19 pm »
vertices are the lines not the faces
Neither...they are the end points of the lines.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Which comes first: setvertexcontroller or build?
« Reply #6 on: November 10, 2014, 12:31:18 pm »
One related question: Why does a cube have 10 vertices and not 8?
Depends on your cube. The ones creates by Primitives have 10, because they are actual lathe objects with addtional points in the center.

Offline Irony

  • long
  • ***
  • Posts: 151
    • View Profile
Re: Which comes first: setvertexcontroller or build?
« Reply #7 on: November 10, 2014, 12:46:54 pm »
Yes I meant the one from Primitives. Thanks.

Offline lawless_c

  • int
  • **
  • Posts: 96
    • View Profile
Re: Which comes first: setvertexcontroller or build?
« Reply #8 on: November 10, 2014, 03:02:28 pm »
vertices are the lines not the faces
Neither...they are the end points of the lines.

oh right, sorry.