Getting normals for Custom Display Host?
| Date : Tue, 07 Mar 2006 15:08:39 +0100 |
| To : xsi(at)Softimage.COM |
| From : André Adam <a_adam(at)49games.de> |
| Subject : Getting normals for Custom Display Host? |
Cheers!
-André
-----
Hi,
we are developing a custom diplay host to display some geometry created with XSI in our inhouse-engine.
To convert the geometry from XSI to our own format we do the following:
- get the XSI::Geometry-object [xgeo] from the XSI::X3DObject to be converted
- get the count of vertices [ xgeo.GetPoints().GetCount(); ]
- get the count of facets [ xgeo.GetFacets().GetCount); ]
Now we can build up a vertex-list and a facet-list. Per facet we'll get a list of points used and they deliver their index in the vertex-list by [point.GetIndex();].
Then we need the UV-sets. No problem:
- search for sample-clusters with "uvspace"-property
- build up the uv-coord-list [ clusterProperty.GetValues(uv[currentUVset]);]
The facet will deliver us a list of samples used and they can tell us their index in the uv-coord-list. [facet.GetSamples(); sample.GetIndex();]
And now finally our problem:
How to do something similar with the normals?
We want to create a list of normals and store the indices in our facet.
But there is no such thing like a normal-list to read from.
When we try to get the normals from the (XSI::)point from the [xgeo.GetPoints();] we get an averaged normal. (No surprise... one Position ... multiple normals ... access to get only one normal.)
We we try to get the normals from the point-list we get from the facet we get the same result. (Obviously the references used are the same which are in the "global"-pointlist so we called the same methods from the same objects.)
We tried to get them another way. We get a triangle-list by [xgeo.GetTriangle();]. And per triangle we get a list of three XSI::TriangleVertex-objects. The XSI::TriangleVertex <classXSI_1_1TriangleVertex.html> delivers the -correct- normal BUT there is no way to map the normal back to the lists we already have. Mainly because we don't know from which facet the triangle was generated.
You could say: Then forget the facets and points and just use the triangle-vertices. The problem is we need to map back to the samples (for getting multiple uv-coords for example) and this is not possible.
Do you know a solution for our problem?
Greetings -Bjoern Gdanietz, 49Games-
--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: Re: Creating a Library - lots of books
- Next by Date: Re: Creating a Library - lots of books
- Previous by Thread: Re: Creating a Library - lots of books
- Next by Thread: Re: Creating a Library - lots of books
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |