Jump to content


Photo

Unable to obtain full texture


  • Please log in to reply
4 replies to this topic

#1 metallic_yoshi

metallic_yoshi

    GMC Member

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

Posted 20 August 2012 - 04:10 AM

GameMaker 8.1,

My 3D models are only obtaining the top left hand corner pixel color of my textures
and is applying that pixel color to my 3D models rather than the entire texture.

I have been using external textures


In Create Event for obj_3d_draw:
if global.textures = 0 then
    {
      global.tex_model = background_add("modeltex.jpg",false,false)
    }



In the Draw Event for obj_model:
if model=0
    {
      d3d_transform_set_identity() 
        d3d_model_draw(global.model,0,0,0,background_get_texture(global.tex_model))
      d3d_transform_set_identity()
    }


Even if I have a Background Called model_texture
Then use this code:
if model=0
    {
      d3d_transform_set_identity() 
        d3d_model_draw(global.model,0,0,0,background_get_texture(model_texture))
      d3d_transform_set_identity()
    }
^the result is the same, only obtaining one pixel color.

If anybody has an exclamation to why this is not working please post so I can be on my
marry way. :)
  • 0

#2 Gamer3D

Gamer3D

    Human* me = this;

  • GMC Member
  • 1590 posts
  • Version:GM8.1

Posted 20 August 2012 - 12:02 PM

Your UV coordinates are 0,0 or unspecified.
  • 1

#3 metallic_yoshi

metallic_yoshi

    GMC Member

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

Posted 21 August 2012 - 01:33 AM

Your UV coordinates are 0,0 or unspecified.


Apperantly what I have is not working then.

What would be the Correct way to Specify the UV coordinates,
so that it works propperly?
  • 0

#4 Gamer3D

Gamer3D

    Human* me = this;

  • GMC Member
  • 1590 posts
  • Version:GM8.1

Posted 21 August 2012 - 09:00 PM

Instead of draw_vertex, use draw_vertex_texture. Look it up in the manual. There's a similar function for 3D.

There's also another possibility. If all your texture coordinates are negative in both dimensions, and texture repetition is off, then the effect will the the same.

Edited by Gamer3D, 21 August 2012 - 09:01 PM.

  • 1

#5 metallic_yoshi

metallic_yoshi

    GMC Member

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

Posted 22 August 2012 - 05:44 AM

Thank you, I was all sorts of messed up. xD

I ended up using d3d_model_vertex_normal_texture_color
Problem Resolved.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users