I want to show several loaded models (meshes) and let the user pick them and move them around (as the cursor), what would be a good method
to achieve this ?
Drawing Mesh as cursor
You could just get the current position of the cursor each frame and update the position of two of the axis ( i.e. the two facing the camera ) but that would be pretty slow.
Couldn't you just use a billboard of what you are dragging when you "pick up" a mesh? Seems to me that it would be a lot easier.
Couldn't you just use a billboard of what you are dragging when you "pick up" a mesh? Seems to me that it would be a lot easier.
-
Guest
billboards are not really the solution.
I try explain again what i want to do:
i want irrlicht to render a level (OctTree) and from a library (prefabs) i want to pick up meshes and place them in the level.
I want also just to render a mesh (still being able to scale) and moving it around on the 2d screen.
I try explain again what i want to do:
i want irrlicht to render a level (OctTree) and from a library (prefabs) i want to pick up meshes and place them in the level.
I want also just to render a mesh (still being able to scale) and moving it around on the 2d screen.
Like a modelling tool? That's possible. There may be a better way but I would update the mesh position while the cursor returns a LMB press, as long as the the cursor is pressed you are dragging the mesh, then just update the mesh positions from the cursor position. You'd have to find some way of changing the axis being moved ( XY, XZ etc ) you could do that by using the RMB as well.
-
Serg Nechaeff
- Posts: 162
- Joined: Wed Nov 26, 2003 5:24 pm
- Location: Europe
here you may move the object within x (-300,300) and y (-220,200) axis:
hope you get the idea
Code: Select all
position2d<f32> m = m_device->getCursorControl()->getRelativePosition ();
vector3df v = nodPlayer->getPosition();
if (m.Y>0.5f && v.Y>-220 ) v.Y-=10;
if (m.Y<0.5f && v.Y<200 ) v.Y+=10;
if (m.X<0.5f && v.X>-300 ) v.X-=10;
if (m.X>0.5f && v.X<300 ) v.X+=10;
m.X=0.5f;
m.Y=0.5f;
m_device->getCursorControl()->setPosition (m);
nodPlayer->setPosition(v);http://www.javazing.com
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
-
Guest
-
Serg Nechaeff
- Posts: 162
- Joined: Wed Nov 26, 2003 5:24 pm
- Location: Europe
i dont know
you have to check it out yoself!
http://www.javazing.com
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6
P-III-950, WinXP, GeForce FX5600 128 MB ForceWare 52.16, DX9, Eclipse IDE, JRE 1.6