Jump to content
  • Advertisement
Sign in to follow this  
_WeirdCat_

Drawing a cricle on the plane

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

SOLVED        SOLVED        SOLVED      SOLVED

 

 

 

 

 

So i have a plane that has a normal n and distance d (normal normalzied)

 

 

i want to draw a circle on it (set some vertices there on the surface)

 

my code looks like this:

determine what direction face (plane) is facing (x or y or z)

 

go through a loop



if (ShockSurfH.algined == 2) { //Y algin so XZ calculus
t1.y = 0;
t1.x = cos(angle*imopi)*(radius-1.0f);
t1.z = sin(angle*imopi)*(radius-1.0f);

t2.y = 0;
t2.x = cos(angle*imopi)*radius;
t2.z = sin(angle*imopi)*radius;

t3.y = 0;
t3.x = cos(angle2*imopi)*radius;
t3.z = sin(angle2*imopi)*radius;

t4.y = 0;
t4.x = cos(angle2*imopi)*(radius-1.0f);
t4.z = sin(angle2*imopi)*(radius-1.0f);

							 }


shockwaveH[i*4+0] = pos+ ( nH * (t1*nH));
shockwaveH[i*4+1] = pos+ ( nH * (t2*nH));
shockwaveH[i*4+2] = pos+ ( nH * (t3*nH));
shockwaveH[i*4+3] = pos+ ( nH * (t4*nH));

i set circle verts on the 'axis' and then project it onto the plane (the 2nd code) however the bigger slope of the plane circle starts to look like an ellipse.

 

How to draw a normal circle?

Edited by WiredCat

Share this post


Link to post
Share on other sites
Advertisement

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

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!