[Papervision3D] Interactive texture wrapping problem

david at gpx.dk david at gpx.dk
Mon Oct 22 03:34:10 PDT 2007


Thanks for the reply Sean,
I figured as much as trying to make up for it by pointing at, say your 9 positions, and then offsetting them somehow! I am just afraid of the offset but I'll give it a go! My concern was that I had to go down and dirty and make a face paint method like the project texture method in the TriangleMesh3D class!

In your example I suppose you say the texture is centered in an mc like this:
(x-w,y-h)---(x,y-h)---(x+w,y-h)
|                                   |
|                                   |
(x-w,y)-------(x,y)-------(x+w,y)
|                                   |
|                                   |
(x-w,y+h)---(x,y+h)---(x+w,y+h)

So this x,y is actually the center of the what you want to draw on the texture and you then paint the 9 positions but with the offset, so that you retrieve the point for the bottom right corner ie. and then move the thing you want to draw on top of it up and to the left.

Hmm, I'll give that a try, and if I'm happy with the result I'll post it....otherwise we're talking low down and dirty :D

Cheers
  ----- Original Message ----- 
  From: Sean Thompson 
  To: papervision3d at osflash.org 
  Sent: Monday, October 22, 2007 12:09 PM
  Subject: Re: [Papervision3D] Interactive texture wrapping problem


  you need to paint on the texture in more than one position at once. if you're painting off the left hand side, you need to also paint onto the right hand side (same for top and bottom, so you would actually have to paint in up to four places at once). 

  if you're feeliong really lazy, you could just paint at (x,y) (x+w,y) (x-w,y) (x,y+h) (x+w,y+h) (x-w,y+h) (x,y-h) (x+w,y-h) and (x-w,y-h) all the time (where w is the width of the texture, and h is the height)



   
  On 20/10/2007, david at gpx.dk <david at gpx.dk> wrote: 
    Hey all,
    I've been following the progress of Papervision for a while and done a few experiments here and there and as most on this list I am now a believer :D

    I tried the drawingtest example, where you can draw randow colors on a blue sphere, and I adapted it to my own textured model too and it works great....except...yup, there's always an exception - in both examples there's a glitch where the texture ends and in the texture wrapped example it's more obvious, as it doesn't take the wrap into account. Is there a way to take the wrapping into account if I want to throw an image on top of the texture? 

    Cheers

    David

    _______________________________________________
    Papervision3D mailing list
    Papervision3D at osflash.org
    http://osflash.org/mailman/listinfo/papervision3d_osflash.org 





  -- 
  Sean Thompson
  Developer
  Dubit Limited 


------------------------------------------------------------------------------


  _______________________________________________
  Papervision3D mailing list
  Papervision3D at osflash.org
  http://osflash.org/mailman/listinfo/papervision3d_osflash.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20071022/c0fc049c/attachment.html 


More information about the Papervision3D mailing list