Solved

Opengl drawing

Posted on 2004-04-21
5
1,365 Views
Last Modified: 2012-06-27
Hi,

Does anyone know a trick to draw a bent cylinder (3D arc) in openGL?
Is it implemented in the glu library? it not, can you help me find the function online?

Thanks
0
Comment
Question by:gamesdev
  • 2
  • 2
5 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 10887836
nehe.gamedev.net

Tutorial 18 will show you how to draw a whole sphere, tutorial 26 will show you how to clip out part of it ... End result, a 3D arc
0
 
LVL 1

Author Comment

by:gamesdev
ID: 10890602
Hi sunnycoder,
The stencil buffer clipping will not result in an arc, also it's not reliable when it comes to drawing tens of them.

Thanks.
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 50 total points
ID: 10896609
If drawing and clipping does not appeal to you, then only option I can think of (I am no openGL expert) is to draw the points on the arc and connect them as triangles
0
 
LVL 2

Assisted Solution

by:timbauer
timbauer earned 50 total points
ID: 10906377
I am really unfamiliar with opengl, but can you use splines in 3-dimensional meshes?
That is to say, any quadratic or cubic parametric equation to connect two points given
control points. I have seen in done in 2D, but was not sure if it is practical in 3D. Seems
like many many little triangles are what get used.

-T

0
 
LVL 1

Author Comment

by:gamesdev
ID: 10907079
Hi,
I was trying to avoid writing that function, guess I have no other choice now!
Thanks for your time, guys!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now