Jump to content


Photo

VERtexes


  • Please log in to reply
6 replies to this topic

#1 flxp

flxp

    GMC Member

  • GMC Member
  • 325 posts
  • Version:GM8

Posted 03 March 2012 - 03:59 AM

is there any topic that covers how vertexes work in gamemaker???
  • 0

#2 BattleRifle BR55

BattleRifle BR55

    Moo

  • GMC Member
  • 8296 posts
  • Version:GM7

Posted 03 March 2012 - 04:57 AM

Did you start with the manual?
  • 0

#3 flxp

flxp

    GMC Member

  • GMC Member
  • 325 posts
  • Version:GM8

Posted 03 March 2012 - 05:36 AM

Did you start with the manual?

yes, and since the first reply wasn't a tutorial all about vertexes, i will just straight ask.

How do i make the draw_vertex_texture or draw_primitive_texture to work??
  • 0

#4 BattleRifle BR55

BattleRifle BR55

    Moo

  • GMC Member
  • 8296 posts
  • Version:GM7

Posted 03 March 2012 - 06:13 AM

So you read the manual, but it wasn't enough? What parts didn't you understand? Let's work from there.
  • 0

#5 flxp

flxp

    GMC Member

  • GMC Member
  • 325 posts
  • Version:GM8

Posted 03 March 2012 - 06:42 AM

well i know how to draw vertices (without textures...)

here is an example:
draw_primitive_begin_texture(pr_trianglestrip,sprite_get_texture(Apple_spr,0))

for (i=0; i<360; i+=5)
{
draw_vertex_texture(x,y,0,0)
draw_vertex_texture(x+lengthdir_x(16,i),y+lengthdir_y(16,i),0,0)
}

draw_primitive_end()
when i don't use the texture part it will show a black circle, but this doesn't show anything...
  • 0

#6 FoxInABox

FoxInABox

    GMC Member

  • GMC Member
  • 5417 posts
  • Version:GM:Studio

Posted 03 March 2012 - 08:01 AM

draw_set_color(c_white) // have to set color to white, as one have to do in 3d mode

draw_primitive_begin_texture(pr_trianglestrip,sprite_get_texture(Apple_spr,0))

for (i=0; i<=360; i+=5)
{
draw_vertex_texture(x,y,.5,.5) // center of the texture is at (.5,.5) top left is (0,0) .. while bottom right is (1,1)
draw_vertex_texture(x+lengthdir_x(32,i),y+lengthdir_y(32,i),.5+lengthdir_x(.5,i+1),.5+lengthdir_y(.5,i+1))
// so for texture you kinda have to draw a circle that got the center at (.5,.5) with a radius of .5
}

draw_primitive_end()

hope that made sence ^^
  • 1

#7 flxp

flxp

    GMC Member

  • GMC Member
  • 325 posts
  • Version:GM8

Posted 03 March 2012 - 09:32 AM

thank you :biggrin:

and for xtex and ytex it is 0.5 as you said for 100% of the sprite's width/height

now i understand it all :D thx
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users