yet another

Blitz3D Forums/Blitz3D Beginners Area/yet another

Ben(t)(Posted 2007) [#1]
How do you get something like maplet's grid selector?
can someone post some code examples I want to understand how to do this.


b32(Posted 2007) [#2]
First, create a plane and make sure it is in view. Then, make it pickable using EntityPickmode plane, 2
In your main loop, use CameraPick camera, mousex(), mousey()
After that, use PickedX/Y/Z to read the picked coordinates.
To convert the coords to a grid, use Int:

xx# = Int(PickedX())
yy# = Int(PickedY())
zz# = Int(PickedZ())

To scale the grid, first multiply PickedXYZ and then divide it again.
Ie:
xx# = Int(PickedX() * 2) / 2.0


Ben(t)(Posted 2007) [#3]
I don't understand the multiply part, why do I need to do this?


b32(Posted 2007) [#4]
You only need it if you want to make the grid bigger or smaller.


big10p(Posted 2007) [#5]
?


*(Posted 2007) [#6]
this will allow you to have something like a thin pillar as not everything is 1,1,1 big