Sign in to follow this  

loading a data array from a COLLADA document

This topic is 1513 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

 

I am trying to write my own COLLADA loader and I have run into trouble when trying to load in arrays of float data. The XML parser I am using is rapidXML and the node object 'value' attribute only returns a string with the data inside the node. How would you efficiently read in an array of 'float' or 'double' values from the document? Would there be any character conversion required? And if so how would you go about converting the values in the fastest way possible?

 

Any replies are appreciated. 

Share this post


Link to post
Share on other sites

So lets guess some here,

i guess you're using C++ and your xml library is returning an std::string for a nodes value attribute.

 

So first you would like to split your string by a delimiter into single number strings.

Then you would want to iterate over the vector of std::strings and use atof on the c strings (.c_str()) to get the double values.

Share this post


Link to post
Share on other sites

This topic is 1513 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this