# Twist wish

Member

24

122 Neutral

• Rank
Member
1. ## if I know 4 point ,how get interpolate?

It could be interpolated, but I haven't find any good link and I don't think I can write the maths here. If I find it I will tell you.But If it's only for a smooth walk you can try to smooth the terrain instead. For example take a look at Smoothing there are two simple ideas to smooth a terrain. Good luck. /* Forgive my english... */ EDIT: I 've used lately a variant of the second one of the link and depending of the terrain I do it more than once. You can also google for bilinear interpolation or bicubic but I haven't tried:(

Quote:Original post by Anonymous Poster you should look up on google something like "AABB in frustum" you don't want to be asking the frustum if points of your AABBs are in the frustum, that wont work as you can see. Thanks. I have thought so much time in quads that I haven't thought about nodes as boxes :( . I found that the same article that I've used before talk about culling cubes so I adapt it to my case. It works pretty well, BUT sometimes I oversee a "phantom" node that appear a bit later than supposed. Could it be because precision or something like that? Thanks in advance. /* forgive my english... */

Well after some resting time and a return to the code I've found an stupid error (arrrrrrgh :) ). Now I have another question. By now I don't have any objects only terrain but the quadtree sometimes don't draw nodes that need to be drawn. I find that you can be "seeing a node but not his corners" And the question is: What can you suggest to do? I have to change the condition of a point being in negative half-space to being in negative half-space AND far from a plane of what?

I'm trying to use a simple quadtree with a program that reads a heightmap a let the user moves with keyboard and mouse but I have a problem. I'm using OpenGL and VC++ but I'm prefer plain C than C++ (maybe later I would try put some stuff in classes). If I draw some nodes directly it works but when I want to restrict the nodes with frustum culling there are some that appear later that it's supposed. To do the frustum culling I'm using this from Mark Morley and I'm implemmented the quadtrees on my own. There is any way to know if the frustum planes are right after the extraccion? I hope someone has some idea about what can be wrong, at least a hint because I have read the code so many hours without knowing what can be. I could post some code if you explain me how to put it in some nice-scrolling-window :) /* As always forgive or better forget my english */ /* I promise I will learn! */
5. ## terrain octrees with VBos

Ahhhh! This is very,very,very familiar! Which Graphics Card do you have? I have a similar problem with a project in university, where I have a GeForce4 MX.At the same time, I use to work with a RADEON 9700 the same code without any problem. If you can (I'm not allowed to in university) try some new drivers. If someone thinks it's something different please say something because in my case, the only work-around that I found after 2 weerks of checking the code is to not use VBO and use VA. /* As always forgive or better forget my english */ /* I promise I will learn! */
6. ## OpenGL hardware accelerated mode

Quote:Original post by Promit Quote:Original post by Twist wish I'm not sure but I would swear that some days ago I was trying a little program in a GPU similar to yours and I had about 60FPS with more than 5000 triangles(I think about 10000 or some more). But what card? I worked with an GeForce4 MX 440 until recently. It's not a terribly powerful card. With a GeForce4 MX 420 I think.It's not mine so I'm not sure.But I'm sure it was a GeForce4 MX.
7. ## moving a point on surface

Quote:Original post by oliii That's a perfectly acceptable solution. Another one is using bilinear interpolation. Take the 4 points around the point on the regular grid, and interpolate between those 4 points to get the height. For an arbitrary mesh, it's more difficult, and it depends what you want to do. What I'd do is start with one triangle and a point on that triangle, and walk along the triangle plane, and the neighbouring triangle when the path crosses an edge. Umm!Thanks oliii I'm sure your solutions is smoother than mine. I must try it! Quote:hmm....how is the plane's formula?!? you can write a plane's formula like this aX + bY + cZ + d = 0 or if you want Y = -(aX + cZ + d)/b where X,Y,Z are the coords of the points and the a,b,c,d are the constants that define the plain. To find the constants you must solve a system imposing that 3 points are in the plain. Let's say you have three points ( x1 , y1 ,z1),( x2 , y2 ,z2),( x3 , y3 ,z3) and you want to know the plane that contains the three, then you must impose: a*x1 + b*y1 + c*z1 + d =0 a*x2 + b*y2 + c*z2 + d =0 a*x3 + b*y3 + c*z3 + d =0 Solve this and you will have a,b,c,d.But wait, three equations, four variables...yes you must impose some valor to one. For example b = 1 and find a,c,d by solving the system. The trick is that if your points are equidistant you can write in a paper many of the operations and the result isn't too complicated. /* As always forgive or better forget my english */
8. ## moving a point on surface

I'm also beginning with this and I had this problem some time ago. Maybe it's not the better solution but :( I'm drawing only triangles. I have a grid with the heights saved in a matrix and with this information I can calculate the plane that contains every triangle(and the normal vectors). Then when the point is above this triangle giving the x and the z and with the plane's formula I can know the y coord. But the grid confines the kind of terrain you can have(all the points equidistants) and surely there's a better way.
9. ## OpenGL hardware accelerated mode

I'm not sure but I would swear that some days ago I was trying a little program in a GPU similar to yours and I had about 60FPS with more than 5000 triangles(I think about 10000 or some more). Maybe you can try some profiling. Anyway take a look to glDrawArrays, Vertex Buffer Objects and Display Lists.
10. ## Camera in OpenGL

From Nehe homepage http://nehe.gamedev.net/data/articles/article.asp?article=08 http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=Quaternion_Camera_Class (The last one with quaternions) and from gamedev http://www.gamedev.net/reference/articles/article1927.asp Good luck
11. ## OpenGL hardware accelerated mode

I don't know if I understand you, but the only two things that come in mind are glutDisplayFunc(renderScene) and glutMainLoop() where renderScene is where you draw the scene:) by the way, what do you mean by software mode?Some kind of error?
12. ## First person Camera movement

If you only want to rotate your camera on Y axis you could try something like that /* (lx,ly,lz) The focus of the camera */ /* angle_h rotation Y axxis. angle_v rotation from ?? axxis. I don't remenber! */ lx = sin(angle_h)*cos(angle_v); ly = -sin(angle_v); lz = -cos(angulo_h)*cos(angle_v); /* Flat movement */ /* (x,y,z) position of the camera /* i = 1 forward , i = -1 backward */ x = x + i*(lx)*velocity; //y = y + i*(ly)*velocity; z = z + i*(lz)*velocity; Well something like that.I hope it will give you a clue(but maybe it isn't correct or the better way:) EDIT: If you discomment that line above.You're camera will actually fly:)
13. ## Lesson 46 problem

For knowing the extensions supported you could also try this: http://www.realtech-vr.com/glview/ Trust me it's pretty good.
14. ## Drawing a terrain with Indexed VBO or what?

Quote:Original post by b3rs3rk You should use an array to keep the vertex data with no duplicates and build an index list for every face. Then call glDrawElements instead of glDrawArray Thanks.I supposed I must have a look in some implementations. But now the question is: I use many triangle strips to draw the terrain.There's any way to concadenate some of them using some linking triangles?(I've heard something about degenerate triangles but I don't know if it's something only to use with LOD's or no) And if this method exists would I gain some perfomance in OpenGL?
15. ## I want a smooth walk!!!!

Quote:Original post by Anonymous Poster This is probably becuase your terrain is too course. When you say you've tried to use interpolation on Z, what exactly do you mean? Probably some source that shows what you are trying to do would help as well. Yes.You're right.It was problem of the terrain. Now I smooth the terrain with a home-made function and it's sooo smooth. The interpolation was an experiment but It didn't work at all. Thanks! Quote:I think you want to create a higer level of detail for nearby polygons. This way you'll have a higher definition "grid", and smoother transitions. You could just interpolate and not render these points, but I'm afraid this would lead to artifacts like the character floating above or sinking into your terrain. I would love to create a LOD but I fear I don't have time...But when I finish the exams I'll try. Thanks!