POV-Ray : Newsgroups : povray.unofficial.patches : Mesh2 uv_vectors problem Server Time
1 Sep 2024 16:15:13 EDT (-0400)
  Mesh2 uv_vectors problem (Message 1 to 10 of 28)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Rune
Subject: Mesh2 uv_vectors problem
Date: 13 Jan 2001 05:47:54
Message: <3a60325a$1@news.povray.org>
Why do the UV vectors in mesh2 only accept UV vectors?
It may sound like a stupid question put like that, but I really see no
reason whatsoever why I can't define my UV-triangles in 3D space. I think
it's a great and very annoying limitation.

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 6)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Peter Popov
Subject: Re: Mesh2 uv_vectors problem
Date: 13 Jan 2001 19:59:49
Message: <7h116tcla1vavb95od4tete6i0mphksb7d@4ax.com>
On Sat, 13 Jan 2001 11:45:46 +0100, "Rune" <run### [at] inamecom>
wrote:

>Why do the UV vectors in mesh2 only accept UV vectors?
>It may sound like a stupid question put like that, but I really see no
>reason whatsoever why I can't define my UV-triangles in 3D space. I think
>it's a great and very annoying limitation.

UV mapping is used to map a 2D texture onto a 3D mesh. I know POV
textures are 3D and one might want to take advantage of that, but tell
this to the image-map geek types who made up UV mapping ;)

Maybe you can use a matrix transform to map the 3D texture to the XY
plane and then use a UV vector on it... just a suggestion.


Peter Popov ICQ : 15002700
Personal e-mail : pet### [at] vipbg
TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

From: Rune
Subject: Re: Mesh2 uv_vectors problem
Date: 14 Jan 2001 06:43:08
Message: <3a6190cc@news.povray.org>
"Peter Popov" wrote:
> "Rune" wrote:
>
> >Why do the UV vectors in mesh2 only accept UV vectors?
> >It may sound like a stupid question put like that, but
> >I really see no reason whatsoever why I can't define my
> >UV-triangles in 3D space. I think it's a great and very
> >annoying limitation.
>
> UV mapping is used to map a 2D texture onto a 3D mesh. I
> know POV textures are 3D and one might want to take
> advantage of that, but tell this to the image-map geek
> types who made up UV mapping ;)

The mesh2 syntax could be changed to accept xyz vectors as well as uv
vectors. I see no reason not to do it.

> Maybe you can use a matrix transform to map the 3D texture
> to the XY plane and then use a UV vector on it... just a
> suggestion.

I originally did "UV-mapping" using matrixes to transform textures for the
individual triangles in a regular mesh, but this required me to remove the
mesh{} block around the triangles, which of course was a great disadvantage,
as the triangles were then not optimised anymore.

So I wanted to use mesh2 instead as it had internal UV-support. I didn't
know it accepted UV-vectors only. Now, if I have to use matrixes again to
get the desired result, I'm back where I started. I have to use a bunch of
unoptimised triangles. Which is not an acceptable solution for me. :(

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 6)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Warp
Subject: Re: Mesh2 uv_vectors problem
Date: 14 Jan 2001 07:32:29
Message: <3a619c5c@news.povray.org>
I think this could be a good idea. It wouldn't break backwards
compatibility either (because povray automatically promotes 2D-vectors
to 3D-vectors with the z coordinate being 0 when needed).

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

From: Chris Huff
Subject: Re: Mesh2 uv_vectors problem
Date: 14 Jan 2001 08:52:51
Message: <chrishuff-64BA6E.08541614012001@news.povray.org>
In article <3a6190cc@news.povray.org>, "Rune" <run### [at] inamecom> 
wrote:

> I originally did "UV-mapping" using matrixes to transform textures 
> for the individual triangles in a regular mesh, but this required me 
> to remove the mesh{} block around the triangles, which of course was 
> a great disadvantage, as the triangles were then not optimised 
> anymore.

I don't understand what you mean...as far as I know, there are no 
problems using per-triangle textures in meshes.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Rune
Subject: Re: Mesh2 uv_vectors problem
Date: 14 Jan 2001 11:14:05
Message: <3a61d04d@news.povray.org>
"Warp" wrote:
>   I think this could be a good idea. It wouldn't break
> backwards compatibility either (because povray automatically
> promotes 2D-vectors to 3D-vectors with the z coordinate
> being 0 when needed).

Exactly.

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 6)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Rune
Subject: Re: Mesh2 uv_vectors problem
Date: 14 Jan 2001 11:14:07
Message: <3a61d04f@news.povray.org>
"Chris Huff" wrote:
> "Rune" wrote:
>
> > I originally did "UV-mapping" using matrixes to transform
> > textures for the individual triangles in a regular mesh,
> > but this required me to remove the mesh{} block around the
> > triangles, which of course was a great disadvantage, as
> > the triangles were then not optimised anymore.
>
> I don't understand what you mean...as far as I know, there
> are no problems using per-triangle textures in meshes.

In a mesh the textures cannot be translated differently for the different
triangles. So to do UV mapping I have to either

A) Remove the mesh{} block around the triangles.

B) Predeclare a unique texture for every single triangle.

Neither of those are attractive solutions.

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 6)
/ Also visit http://www.povrayusers.org


Post a reply to this message

From: Chris Huff
Subject: Re: Mesh2 uv_vectors problem
Date: 14 Jan 2001 11:36:38
Message: <chrishuff-2499EF.11375714012001@news.povray.org>
In article <3a61d04f@news.povray.org>, "Rune" <run### [at] inamecom> 
wrote:

> In a mesh the textures cannot be translated differently for the different
> triangles. So to do UV mapping I have to either
> 
> A) Remove the mesh{} block around the triangles.
> 
> B) Predeclare a unique texture for every single triangle.
> 
> Neither of those are attractive solutions.

How about:
C) Declare an array of textures. Use the textures in the array instead 
of individual textures.

Or:
D) Write a macro that declares a texture (transformed to fit) and then 
uses it in a triangle. This *should* work...in fact, I think it has been 
done.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Nicolas Calimet
Subject: Re: Mesh2 uv_vectors problem
Date: 14 Jan 2001 12:00:11
Message: <3A61ECA2.4422385F@free.fr>
> In a mesh the textures cannot be translated differently for the different
> triangles. So to do UV mapping I have to either 
> A) Remove the mesh{} block around the triangles.
> B) Predeclare a unique texture for every single triangle.

	For B) I suppose you suggest something like:

#declare t1=texture{... transform ...}
#declare t2=texture{... transform ...}
...
mesh{
  triangle{ ... texture{t1} }  // or smooth triangle
  triangle{ ... texture{t2} }
  ...
}

which of course requires a lot of memory to declare both texture variables
and textures in the mesh. But what about the following syntax ?

mesh{
  #declare t=texture{ ... transform ...}  // #local is more elegant ?
  triangle{ ... texture{t} }
  #declare t=texture{ ... transform ...}
  triangle{ ... texture{t} }
  ...
}

which might be only a little longer to parse... maybe not.

	In case you were talking about this syntax, please ignore my post !
	BTW declaring UV vectors with XYZ should change the mesh2 syntax ;-)


*** Nicolas Calimet
*** http://pov4grasp.free.fr


Post a reply to this message

From: Rune
Subject: Re: Mesh2 uv_vectors problem
Date: 14 Jan 2001 17:27:51
Message: <3a6227e7@news.povray.org>
"Chris Huff" wrote:
> "Rune" wrote:
> > In a mesh the textures cannot be translated differently for
> > the different triangles. So to do UV mapping I have to either
> >
> > A) Remove the mesh{} block around the triangles.
> >
> > B) Predeclare a unique texture for every single triangle.
> >
> > Neither of those are attractive solutions.
>
> How about:
> C) Declare an array of textures. Use the textures in the array
>    instead of individual textures.

That's what I meant in B) of course. But it's still individual textures no
matter if they're in an array or not.

> D) Write a macro that declares a texture (transformed to fit)
> and then uses it in a triangle. This *should* work...in fact,
> I think it has been done.

Now I'm completely confused.

Maybe you've misunderstood me. Coding the POV-script that does the
UV-mapping is not the problem at all. I've already done that, and it works.
The problem is the amount of memory required: One unique texture for every
single triangle.

Rune
--
\ Include files, tutorials, 3D images, raytracing jokes,
/ The POV Desktop Theme, and The POV-Ray Logo Contest can
\ all be found at http://rsj.mobilixnet.dk (updated January 6)
/ Also visit http://www.povrayusers.org


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.