Problem with scaletexture?

Blitz3D Forums/Blitz3D Programming/Problem with scaletexture?

Guy Fawkes(Posted 2012) [#1]
Hi all. I am trying to build a simple sword in blitz3d using only scaled, positioned, and rotated shapes. Problem is, I went to texture the 1st part of the sword with a gradient texture, and for some reason, it only textures PART of the mesh, while leaving the other part of the texture black, making PART of the mesh appear black... i want it to be perfectly aligned to the mesh, no matter what.


Here's the code:





Thank you to all who help! :)


stayne(Posted 2012) [#2]
Question first. What does this do?

If CHANGE VertexTexCoords s, v, VertexU( s, v ) * ScaleU , VertexV( s, v ) * ScaleV


Guy Fawkes(Posted 2012) [#3]
It's supposed to scale the texture correctly. problem is. some of the mesh's texture is still black ><


Krischan(Posted 2012) [#4]
Global objtex=DrawGradientSurface(mytex,102,102,255,68,207,252,0,0,imgwidth#,imgheight#)


Guy Fawkes(Posted 2012) [#5]
THANK you Krischan. That was driving me CRAZY! O_O


Guy Fawkes(Posted 2012) [#6]
Ugh! Now another problem.... Why does this texture make the object appear to have a "dent" in it?





H&K(Posted 2012) [#7]
This is just a guess, (Because I dont have the texture), but possibly its designed to make it look like it has a dent in it?

Thun, have you got any screen shots of your project you could post, Im quite interested in seeing what you have got done so far


Guy Fawkes(Posted 2012) [#8]
No. its designed to be a gradient. because im the 1 who coded the design into it using the gradient code u see before u.

Now, here's some screenshots of it. 1 with wireframe, and 1 without wireframe:


Wireframe:





No Wireframe:




Kryzon(Posted 2012) [#9]
You're gonna have a hard time removing that.
It's a "feature" of spherical mapping, there's gotta be a seam somewhere (as you're trying to map a rectangular area onto a spherical one).

Have you tried loading that texture with the Spherical Environment flag? it'll hide the seam at the cost of three-dimensionality (you'll always see the gradient at front).

Otherwise you can map a sphere in a modelling program to view in real-time and then tweak the texture in your favourite image-editing program until it looks acceptable. Then proceed to use it in your game.


sting(Posted 2012) [#10]
Rotate the gradient 90 degrees.


Ross C(Posted 2012) [#11]
You could try a cubemap.


Guy Fawkes(Posted 2012) [#12]
I tried rotating the texture 90 degrees. that ALMOST worked. there's a little spot where it still looks like a "dent", when it should look like a blue marble.





Problem:





_PJ_(Posted 2012) [#13]
Have you tried setting it to use vertex shading instead with Fullbright on?