7sfS5fmzDjk
Sadly, water can’t expand to another chunk.
7sfS5fmzDjk
Sadly, water can’t expand to another chunk.
Looking cool, keep up the good work!
Wow that’s fantastic! I love how that’s all working.
I’m sure you will find a way to solve that. When I did the water on my map I stored the water In another array, this was partly because I used a second render pass to draw it semi -transparent. But it also solved the problem of it not being bound to chunks.
I’m not suggesting you do that, but a temporary list of moving water may help get around that. Or some good methods that deal with chunk boundaries. Looks great!
I found some time and started working on the engine again, but I still cannot get the holding cube right. Can someone send me a working piece of code about the holding cube?
Some of the strangle results:
VFrsQmG3zQw
Paul.
Draw it last and don’t do any depth testing.
Mike
I looks like you are not translating and rotating it properly.
this is from a page on my blockworld page
you can also download my code, its on there somewhere. This part is halfway down the render method
I don’t translate the position - just set identity and position the cube after.
I just do:
glLoadIdentity();
GL11.glRotatef(10, 0, 0, 1);
GL11.glTranslatef(-0.05f, (walkbias / 2.3f) + 0.9f, 0.4f);
// draw cube
The above is called after my camera has been translated.
glLoadIdentity();
GL11.glRotatef(10, 0, 0, 1);
GL11.glTranslatef(-0.05f, (walkbias / 2.3f) + 0.9f, 0.4f);
// draw cube
What walkbias is?
It’s just a value that is calculated to get a bobbing effect - I got the idea from Vermeer who I believe got it from one of nehe’s tuts.
You can just do:
GL11.glTranslatef(-0.05f, 0.9f, 0.4f);
You may have to play around with the values dependant on your camera position.
I found some time and started working on the engine again, but I still cannot get the holding cube right. Can someone send me a working piece of code about the holding cube?
Some of the strangle results:
VFrsQmG3zQw
Paul.
Yes walkbias is from NEHE’s tutorial. I have scaled it down by 2.3 as the motion does not need to be as pronounced as the full bias of the character.
Draw it last and don’t do any depth testing.
Mike
I looks like you are not translating and rotating it properly.
this is from a page on my blockworld page
you can also download my code, its on there somewhere. This part is halfway down the render method
I don’t translate the position - just set identity and position the cube after.
I just do:
glLoadIdentity();
GL11.glRotatef(10, 0, 0, 1);
GL11.glTranslatef(-0.05f, (walkbias / 2.3f) + 0.9f, 0.4f);
// draw cube
The above is called after my camera has been translated.
glLoadIdentity();
GL11.glRotatef(10, 0, 0, 1);
GL11.glTranslatef(-0.05f, (walkbias / 2.3f) + 0.9f, 0.4f);
// draw cube
What walkbias is?
It’s just a value that is calculated to get a bobbing effect - I got the idea from Vermeer who I believe got it from one of nehe’s tuts.
You can just do:
GL11.glTranslatef(-0.05f, 0.9f, 0.4f);
You may have to play around with the values dependant on your camera position.
Yes walkbias is from NEHE’s tutorial. I have scaled it down by 2.3 as the motion does not need to be as pronounced as the full bias of the character.
Thank you all for your help. I used steg90’s method, and it worked. I was expecting something more compilicated with usage of trigonometry to tell you the truth.
My current problem is that from some angles, players cannot see the rest of the blocks through a transparent block. At some points it seems like there are no other blocks behind the transparent ones like water. I don’t know if my explanation is good enough to understand. I am not sure what causes that.
Paul.
To fix this problem (almost):
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA,GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glAlphaFunc(GL11.GL_GREATER, (float) 0.1);
And then you will also have to do depth-sort your chunks.
Then render opaque things front-to-back, and then render back-to-front transparent things.
Example:
List<?> visibleChunks = ???;
Collections.sort(visibleChunks,frontBackDistanceSort);
for(int n = 0; n < visibleChunks.size(); n++)
visibleChunks.get(n).renderCall(OPAQUE);
for(int n = visibleChunks.size()-1; n >= 0; n--)
visibleChunks.get(n).renderCall(TRANSPARENT);
Thank you all for your help. I used steg90’s method, and it worked. I was expecting something more compilicated with usage of trigonometry to tell you the truth.
My current problem is that from some angles, players cannot see the rest of the blocks through a transparent block. At some points it seems like there are no other blocks behind the transparent ones like water. I don’t know if my explanation is good enough to understand. I am not sure what causes that.
Paul.