Public Group

Finding bounds of a square on the cube or something like that

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

Recommended Posts

Hello.
I found interesting method about detecting on which side of cube user clicked:
http://stackoverflow.com/a/5655442

But i don't understand it fully.
Also i don't get it, to which corner (?) for example (100,0,0) or (0,0,100) belongs.

If somebody understands it, what he said or how are the bounds calculated, then please explain.
I have same cube size 1x1x1. But im in OpenGL, not XNA, if that matters.

I would like to try out this but i don't understand it.

A pic would help also.

Thanks in advance. Edited by BytePtr

Share on other sites
OK as usually after posting topic, i got this to work but not fully.

Because for each cube the X,Y,Z coords change, i need to somehow calculate the bounds using also the X,Y,Z coords. Relative to to block coords or something, but i don't know the math behind it.

If for example: X=4, Y=3, Z=6, how i should calculate bounds for it?
Block size is 1x1x1 (100x100x100) pixels always.

For X0,Y0,Z0 i got really bounds like: 0-1 (float values from gluUnproject, without casting them to int's). But for coords like X1, Y1, Z1 it will no longer work.

Should i multiply X,Y,Z with 1 or something? Or subtract something? I just don't know.

1. 1
2. 2
3. 3
4. 4
frob
14
5. 5

• 16
• 13
• 20
• 12
• 19
• Forum Statistics

• Total Topics
632168
• Total Posts
3004543

×