Click here to Skip to main content
13,147,689 members (30,920 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello guys!

So i have this problem when i'm programming in C# using openGL library. The main project is, to draw a road from x,y,z coordinates that i got from some trip i made.. Well.. i've managed to DRAW the road but it's visible like a simpel 'circle' in the openGL environment.

Like this:[^]

How i want it to be shown is on this picture:[^]

The picture is just an example of how i want it to be visible. So the maint point is, to get a 3D feeling from the road.. not a simple perspective from 'above'. I've tried rotating the camera but i dont get the right results.

Can u please help me on this? or give me some tutorials where its shown how to get this 3D view of a line...

I hope i've explained it well...if not just ask me and i'll try better!

Posted 23-Nov-12 7:22am
Sergey Alexandrovich Kryukov 23-Nov-12 13:55pm
This might be an interesting question, but I'm not sure your approach to asking questions might be not very productive. Tomorrow you will need to draw a piece of bread, and later a glass of water. Will each object make more and more questions? Even the simplest 3D models are more general...
tokano 23-Nov-12 16:51pm
Well yes, maybe i will have to draw different things..but the question is still simple. How to get this '3D LOOK' on the road i am drawing.. I got all the 3 coordinates, still the object looks like 2D. There is something i am not doing right..and any help in this direction would be usefull..

Maybe i am just searching for someone to push me in one direction i should search for the solution..
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Hi guys!

I've solved it! The biggest problem was the little difference between coordinates. As i drove with my car mapping the coordinates, the road was really up and down...and i thought, man i go very high, so this has to be seen on the program then!

After giving the coordinates in i saw nothing. I solved this using i draw each line at every point i've made and the line was long as the height!

The next problem was.. i got X Y Z coordinates.. and i used Z as the HEIGHT difference. The coordinate system of openGL uses Y axis as up and down... so i switched these and got a road from a better perspective! (the right one!) After drawing lines i got also the 3D feeling of the road.

Here the picture:[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It's not clear if you are asking about how to draw the road as a 3D object, or correct issues you have with manipulating the camera.

Your statements: "tried rotating the camera" and "get this 3D view of a line" seem to imply your problem is with the camera.

[EDIT] Sorry, this is a comment not a solution, no way to change status. [/EDIT]
tokano 24-Nov-12 6:25am
No problem about the answer..

Well, i do not know what should i FIX to make my road look like 3D. I just pointed out two of the things i might have the problem with. Maybe the solution is a third one. I thought that if i get draw the x y z coordinates, everything will be ok from that point on..but looks like 2D:S
cmk 24-Nov-12 7:37am
Again, not sure what you mean by "look like 3D".

Do you mean you expect to see the black line you have, but as you move the camera so you are looking 'edge on' you see the difference z values.

Or do you mean that you expect the line to look like an extruded rectangle.
tokano 24-Nov-12 8:19am
Well the picture i gave you, gives me the 3D feeling.

This one:

I dont want all the fancy texture and red dots..just the road in this kind of perspective.. What i get is in the first post, the first picture.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Lets start with fixing any camera issue.
You said you tried rotating the camera but ddin't get the 'right results'.
Do you have a picture of what you get when you rotate the camera ?
Nelek 24-Nov-12 13:52pm
Please don't post solutions to add information, to ask something or to comment another user.
- To add information to your message, you can use the widget "Improve question" / "Improve solution" at the bottom of your text.
- To ask/answer a user, you can use the widget "Have a question or comment?" (as I am doing right now with you) or the widget "reply" in another comment.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170915.1 | Last Updated 25 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100