• 9
• 10
• 10
• 11
• 17
• ### Similar Content

• Good evening everyone!

I was wondering if there is something equivalent of  GL_NV_blend_equation_advanced for AMD?
Basically I'm trying to find more compatible version of it.

Thank you!

• Hello guys,

How do I know? Why does wavefront not show for me?
I already checked I have non errors yet.

And my download (mega.nz) should it is original but I tried no success...
- Add blend source and png file here I have tried tried,.....

PS: Why is our community not active? I wait very longer. Stop to lie me!
Thanks !

• I wasn't sure if this would be the right place for a topic like this so sorry if it isn't.
I'm currently working on a project for Uni using FreeGLUT to make a simple solar system simulation. I've got to the point where I've implemented all the planets and have used a Scene Graph to link them all together. The issue I'm having with now though is basically the planets and moons orbit correctly at their own orbit speeds.
I'm not really experienced with using matrices for stuff like this so It's likely why I can't figure out how exactly to get it working. This is where I'm applying the transformation matrices, as well as pushing and popping them. This is within the Render function that every planet including the sun and moons will have and run.
if (tag != "Sun") { glRotatef(orbitAngle, orbitRotation.X, orbitRotation.Y, orbitRotation.Z); } glPushMatrix(); glTranslatef(position.X, position.Y, position.Z); glRotatef(rotationAngle, rotation.X, rotation.Y, rotation.Z); glScalef(scale.X, scale.Y, scale.Z); glDrawElements(GL_TRIANGLES, mesh->indiceCount, GL_UNSIGNED_SHORT, mesh->indices); if (tag != "Sun") { glPopMatrix(); } The "If(tag != "Sun")" parts are my attempts are getting the planets to orbit correctly though it likely isn't the way I'm meant to be doing it. So I was wondering if someone would be able to help me? As I really don't have an idea on what I would do to get it working. Using the if statement is truthfully the closest I've got to it working but there are still weird effects like the planets orbiting faster then they should depending on the number of planets actually be updated/rendered.

• Hello everyone,
I have problem with texture

• Hello everyone
For @80bserver8 nice job - I have found Google search. How did you port from Javascript WebGL to C# OpenTK.?
I have been searched Google but it shows f***ing Unity 3D. I really want know how do I understand I want start with OpenTK But I want know where is porting of Javascript and C#?

Thanks!

# OpenGL help for creating a 3D landscape like this one (OpenGL+Java)

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

## Recommended Posts

Hi,
I'm an average Java coder, and now I want to learn OpenGL (in Java) to make a landscape like the one shown in the picture below (it's a Linux screensaver).

Actually, the color stuff is not what I'm interested in: what I would like to achieve is just the wireframe view of such a landscape (pretty basic thing in OpenGL, I imagine...)

So Big, Big, Big Thank You for providing me any piece of advice (or code) you have about what I should do in order to create a wireframe landscape!!!!!!!

PS: if your tips, lines of code or weblinks deal with C/C++/C#, no problem, I'll figure out how to make it work in Java, so feel free to post any piece of help (because I'm really starting from scratch on this one, and I really want to code it!). Thank you very much!

##### Share on other sites
EDIT:
I'm thinking of software rendering... Edited by fastcall22

##### Share on other sites
Do you want to load just a basic mesh and display it or do you want to do something cool and construct it from a heightmap or something? How are you using opengl in java is it JOGL or lwjgl or something else? If your using the heightmap way what you want to do is load a grayscale image in a way that you can address each pixel and ill give you some psuedocode:

 int vertindex; for(int x = 0; x < image.w; x++) { for(int y = 0; y < image.h; y++) { vertices[vertindex*3] = x; //vertex x-coordinate vertices[1 + vertindex*3] = y; //vertex y-coordinate vertices[2 + vertindex*3] = image.pixels[x][y]; //vertex z-coordinate vertindex += 1; } } glEnableClientState(GL_VERTEX_ARRAY); unsigned int vBuffer; glGenBuffers(1, &vBuffer); glBindBuffer(GL_ARRAY_BUFFER, vBuffer); glBufferData(GL_ARRAY_BUFFER, vertindex * 3 * sizeof(float), vertices, GL_STATIC_DRAW); glVertexPointer(3, GL_FLOAT, 0, 0); glDrawArrays(GL_LINES, 0, vertindex); 

That's basically how you do it in psuedomodern opengl.

Legacy opengl is a bit easier but is reeeeaaaaly slow:

 int vertindex; glBegin(GL_LINES); for(int x = 0; x < image.w; x++) { for(int y = 0; y < image.h; y++) { glVertex3f(x, y, image.pixels[x][y]); } } glEnd(); 

attached is a sample heightmap Edited by ic0de

##### Share on other sites
Thank you for your replies: it's much appreciated!

Actually, I thought about pure random/procedural generation (I'm fond of these things) for creating the landscape (so generating a heightmap is an actual option, yes).
The ultimate step would be to be able to generate an infinite terrain (and "fly" over it).

And for using OpenGL with Java, I haven't decided yet between JOGL or lwjgl (I'm looking for something that works in Android)

Thank you for your help! Edited by Nico_gamedev

##### Share on other sites
For automatic generation of height data, have a look at simplex noise (similar to Perlin noise). In the "External Links" section to Stefan Gustavsson (http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf) , you will find another reference to a Java implementation of this.

You would use 2D simplex noise (using X and Y as argument) for height map generation. To get really interesting things, you can use 3D simplex noise for density. The density can be used for many things: Creating caves, used as a probability for vegetation, etc.

##### Share on other sites
NeHe wrote nice tutorial about creating terrain from height maps, which was later ported to Java, you should probably read this:
http://nehe.gamedev.net/tutorial/beautiful_landscapes_by_means_of_height_mapping/16006/