Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Basic Transformation

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 codder88   Members   

103
Like
0Likes
Like

Posted 09 February 2013 - 01:02 PM

triangle.png

 

Hello everyone,

 

I have that triangle and I want to move top vertex, how can I do that?



#2 slicer4ever   GDNet+   

6670
Like
0Likes
Like

Posted 09 February 2013 - 07:15 PM

open up your favorite 3D modeling software, select it, and move it over.

 

seriously though, if you only want to move a single vertex, then you need to change it's position before you submit it to the gpu.

 

without seeing what your doing with code, and you telling us what u've learned/why your having problems, then we can't help you.


Edited by slicer4ever, 09 February 2013 - 07:15 PM.

Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

#3 __SKYe   Members   

1719
Like
0Likes
Like

Posted 15 February 2013 - 08:59 AM

IF you're using the old OpenGL, then you're probably using something like this to draw the triangle:

I assume you're using glBegin()/glEnd() pairs, since you don't know how to move a vertex.

glBegin(GL_TRIANGLES);
glVertex3f(-1.0f, -1.0f, 0.0f);
glVertex3f( 1.0f, -1.0f, 0.0f);
glVertex3f( 0.0f,  1.0f, 0.0f); //In this example this is the top vertex
glEnd();

 

So in this code, the top vertex is the last, so to move it, change the values of the last glVertex3f() call.



#4 blueshogun96   Members   

2248
Like
0Likes
Like

Posted 16 February 2013 - 06:52 PM

I'm a bit confused, do you want to make the triangle a bit taller, or do you actually want to use OpenGL's transformation functions to "resize" it?

 

Shogun.


Follow Shogun3D on the official website: http://shogun3d.net

Posted Image Posted Image Posted Image Posted Image

"Yo mama so fat, she can't be frustum culled." - yoshi_lol

"One objection to a “critique of C#” would be that you can’t talk about C# without talking about the whole “.Net experience”. However, one can approach the topic of Hitler without a complete discussion of Nationalist Socialism, so I feel justified." - Steve White.




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.