hi guys,
im searching for a way to convert vector3df to 3 ints, you know one for x, for y and for z coordinate...
thanks,
Halan
vector3df to int
Code: Select all
core::vector3d< int > intVec = core::vector3d< float >( 1.0f, 1.0f, 1.0f );
-
- Posts: 377
- Joined: Fri Oct 28, 2005 10:28 am
- Contact:
-
- Posts: 377
- Joined: Fri Oct 28, 2005 10:28 am
- Contact:
http://irrlicht.sourceforge.net/docu/cl ... tor3d.html
And I am very sure your compiler just didn't say "Doesn't work". It gave you a specific error message. Seriously, why is it so difficult to provide a proper problem description?
And I am very sure your compiler just didn't say "Doesn't work". It gave you a specific error message. Seriously, why is it so difficult to provide a proper problem description?
-
- Posts: 61
- Joined: Sun May 08, 2005 11:30 am
int x = int(vector.X);
int y = int(vector.Y);
int z = int(vector.Z);
or exchange "int" for "s32"
make sure you havent mistyped the vector name. If you're using visual studio it should pop up the members of vector after you get to "vector."... if not then you may have an error elsewhere. Make sure to tell us error if you need help so we can figure out why yours isnt working.
int y = int(vector.Y);
int z = int(vector.Z);
or exchange "int" for "s32"
make sure you havent mistyped the vector name. If you're using visual studio it should pop up the members of vector after you get to "vector."... if not then you may have an error elsewhere. Make sure to tell us error if you need help so we can figure out why yours isnt working.
I don't get the problem just do:
vector3df vec;
int x = vec.X;
int y = vec.Y;
int z = vec.Z;
vector3df vec;
int x = vec.X;
int y = vec.Y;
int z = vec.Z;
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.