Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# OpenGL 3D
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: http://shrani.si/f/3H/wC/2XuyB7fp/untitlessd.png[^]
 
How i want it to be shown is on this picture:
 
http://static.usenix.org/event/usenix05/tech/freenix/full_papers/kirsch/kirsch_html/img/street.jpg[^]
 
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!
 
cheers
Posted 23-Nov-12 8:22am
tokano501
Comments
Sergey Alexandrovich Kryukov at 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...
--SA
tokano at 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
good
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 lines...so 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:
 
http://shrani.si/f/1Q/7k/3pocMfRv/untitled.png[^]
  Permalink  
Rate this: bad
good
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]
  Permalink  
v2
Comments
tokano at 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 nope..it looks like 2D:S
cmk at 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 at 24-Nov-12 8:19am
   
Well the picture i gave you, gives me the 3D feeling.
 
This one: http://static.usenix.org/event/usenix05/tech/freenix/full_papers/kirsch/kirsch_html/img/street.jpg
 
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
good
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 ?
  Permalink  
Comments
Nelek at 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)



Advertise | Privacy | Mobile
Web04 | 2.8.1411022.1 | Last Updated 25 Nov 2012
Copyright © CodeProject, 1999-2014
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