cassius Posted August 31, 2012 Share Posted August 31, 2012 How is "StringToVec3" expressed in c++? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
flachdrache Posted September 1, 2012 Share Posted September 1, 2012 There was a collection of utility functions in the old scene loader sample. You may find those by searching the forum or download the old source. I, however, took this from the utility.cpp from rolands c++ scene loader sample - which might be a better choise because its more up-to-date. TVec3 StringToVec3( const string& s, char delimiter ) { stringstream ss ; ss << s ; TVec3 v ; if( delimiter == ' ' ) ss >> v.X >> v.Y >> v.Z ; else { char d1, d2 ; ss >> v.X >> d1 >> v.Y >> d2 >> v.Z ; } return v ; } hth Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
cassius Posted September 1, 2012 Author Share Posted September 1, 2012 Thanks. Do you know where I can find Rolands scene loader example.? I have searched the forum but can only find old stuff some of which was posted cos it contains errors. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
flachdrache Posted September 1, 2012 Share Posted September 1, 2012 It seams to be no longer in the download section - if there is no LEBuilder sample which contains the "scene loader utility.cpp" then you might post him about a re-release. Utilitys are most likely included in the gamlib source base too - it does thinks a little different and uses "framewerk" iirc, which doesnt matters for the helper/utillity functions though. Finally the "scripts" folder holds some lua versions like : -- // ... local toStart=string.Explode(moveToStart,",") x=tonumber(toStart[1]) y=tonumber(toStart[2]) z=tonumber(toStart[3]) self.model:SetPosition(Vec3(x,y,z)) ... which uses "," as delimiter which would be faster with a smaller memory footprint imo. Quote AMD 64 X2 Dual 5k - 4GB - XFX GForce9800GT - nv196.21 - WinXP Sp3 zBrush4R2 - Silo2Pro - Unwrap3DPro - Gile - MaPZone2.5 Xxploration FPS in progress ... Link to comment Share on other sites More sharing options...
Roland Posted September 1, 2012 Share Posted September 1, 2012 Hi... Here is the sceneloader and some string utils. Attached is a sample how to use it, including a test scene 1 Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
AggrorJorn Posted September 1, 2012 Share Posted September 1, 2012 Very useful. Thanks for the upload. Quote Link to comment Share on other sites More sharing options...
cassius Posted September 1, 2012 Author Share Posted September 1, 2012 Thanks Roland. Thanks for all answers. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.