How to change SoCoordinate3

How to change SoCoordinate3

Post by Giancarlo Amat » Wed, 02 Jul 2003 17:22:46



Hello Everybody,
I'm new to Inventor, so I need some help.
I have a SoCoordinate3 object which defines a set of a nurbs curve. After
some calculations, I have new control points. How can I change my
SoCoordinate3?, I tryied to destroy it and rebuild, but my system screamed,
I tryed also to destroy the entire curve separator and rebuild it but always
with some errors.

Thank for the help.
Giancarlo

 
 
 

How to change SoCoordinate3

Post by Marcus Sinderma » Fri, 04 Jul 2003 18:24:18



> Hello Everybody,
> I'm new to Inventor, so I need some help.
> I have a SoCoordinate3 object which defines a set of a nurbs curve. After
> some calculations, I have new control points. How can I change my
> SoCoordinate3?, I tryied to destroy it and rebuild, but my system screamed,
> I tryed also to destroy the entire curve separator and rebuild it but always
> with some errors.

> Thank for the help.
> Giancarlo

Hi!

Use one of the setValues functions of the class SoMFVec3f, for
example:

SoCoordinate3 *myCoords = new SoCoordinate3;
myCoords->point.setValues(startIndex, numberOfValues, values);

values can be an array of SbVec3f or a float[3] array for example.
Look at the docu for class SoMFVec3f for the different set methods.

Bye
Marcus

 
 
 

1. SoCoordinate3 & Changing values

i have a piece of code that constantly recomputes a mesh according
to some input values and then renders the new one on the render
area. the problem is - if i change the number of vertices to
be smaller than the previous one - inventor still tries to use
the same number of vertices that it used the last time - i am not
sure about this - i came up with this conclusion after observing
the "nifty" images that i get after i change the number of vertices
to a smaller one. for example, if i have something like:

// allocate memory for the vertices array
vertices - an array of x,y,z vertices

// compute the vertices
...

// put them into a SoCoordinate3
ModelCoordinate3 -> point.setValues (0, n, vertices);

// delete the array
delete [] vertices;

(next call of the function)
// allocate memory for n-10 vertices
...

// recompute the vertices
...

// now we have less vertices
ModelCoordinate3 -> point.setValues (0, n - 10, vertices);

// delete the array
delete [] vertices;

i get a complete mess probably because inventor still tries to
use n number of vertices? or maybe i am wrong?

any ideas whats going on here?

KV
--


http://www.erc.msstate.edu/~vkire        Mississippi State University
P.O. Box 3167, MS State, MS 39762        Engineering Research Center/NSF

2. Elliptical Fits

3. Error no standard conversion of SoCoordinate3* to SoNode*

4. **BEST C++ BOOK YOU SHOULD KNOW

5. SoCoordinate3 and Engines

6. Camra movement via Matrixes vs. Values.

7. relations between SoCoordinate3 and vertices in SoShape ??

8. Curves

9. connecting an engine to SoCoordinate3

10. Manipulator working on subsets of SoCoordinate3?

11. Empty SoCoordinate3 and the State

12. Engines and SoCoordinate3

13. How to connect SoElapsedTime to SoCoordinate3?