spherical environment on moving object

  • Permalink
  • submit to reddit
  • Email
  • Follow


I've put a simple spherical reflection map on my object using:

glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);		
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);

Now object moves around the scene in long linear segments, then turns 
rapidly and continues in another direction for some time. Camera is 
always positioned and oriented exactly the same relative to the object - 
meaning the environmental reflection is always the same during the 
traversal in one direction.

Id like to fake the reflection changes so it looks like object is 
passing thru other objects around it, reflecting them.

I suppose it could be done by manipulating texture stack. Is there a 
common way to do this? What transformation to apply to texture stack to 
make this look "good"?
0
Reply Mirko 7/5/2006 7:38:35 PM

See related articles to this posting


Mirko Puhic wrote:

> I suppose it could be done by manipulating texture stack. Is there a 
> common way to do this? What transformation to apply to texture stack to 
> make this look "good"?

typo: texture matrix that is, not texture stack.
0
Reply Mirko 7/5/2006 7:40:05 PM

Mirko Puhic wrote:
> Id like to fake the reflection changes so it looks like object is 
> passing thru other objects around it, reflecting them.
> 

I don't think you can do it with an environment map,
you need to look into cube mapping (the next step
up from environment mapping).

> I suppose it could be done by manipulating texture stack. Is there a 
> common way to do this? What transformation to apply to texture stack to 
> make this look "good"?

None, because at the end of a day an environment map
only covers the half of your object which is facing
the viewer. You can't rotate the "back" into view
because there isn't one.


-- 
<\___/>
/ O O \
\_____/  FTB.    For email, remove my socks.

In science it often happens that scientists say, 'You know
that's a really good argument; my position is mistaken,'
and then they actually change their minds and you never
hear that old view from them again.  They really do it.
It doesn't happen as often as it should, because scientists
are human and change is sometimes painful.  But it happens
every day.  I cannot recall the last time something like
that happened in politics or religion.

- Carl Sagan, 1987 CSICOP keynote address

0
Reply fungus 7/6/2006 12:34:57 AM

fungus wrote:
> Mirko Puhic wrote:
>> Id like to fake the reflection changes so it looks like object is 
>> passing thru other objects around it, reflecting them.
>>
> 
> I don't think you can do it with an environment map,
> you need to look into cube mapping (the next step
> up from environment mapping).
> 
>> I suppose it could be done by manipulating texture stack. Is there a 
>> common way to do this? What transformation to apply to texture stack 
>> to make this look "good"?
> 
> None, because at the end of a day an environment map
> only covers the half of your object which is facing
> the viewer. You can't rotate the "back" into view
> because there isn't one.
> 
> 

I follow you but... The idea was to trasnform generated texture 
coordinates to get the appearance of reflection sliding over the object. 
First I naively tried:

glMatrixMode( GL_TEXTURE );
glLoadIdentity();
glTranslatef( time, time, time );

But this just slides in the black areas. What I had in mind was to 
transform/animate the texture coordinates in a way that they stay mapped 
inside envmap circle. Kind of like rotating the s,t coordinates around 
the texture center.

In other words to achieve the same effect as if env hemisphere would be 
rotating around the principal axis. So no "back side" hemisphere is ever 
reflected.

I tried a number of transformations in texture matrix mode but nothing 
seems to rotate the map in a desired way.

Doing it with cube map seems pretty straightforward.
Only problem is - I'd prefer to do it without using extensions.
0
Reply Mirko 7/6/2006 3:56:44 AM

Mirko Puhic wrote:
> 
> ...this just slides in the black areas. What I had in mind was to 
> transform/animate the texture coordinates in a way that they stay mapped 
> inside envmap circle. Kind of like rotating the s,t coordinates around 
> the texture center.
> 

The only transformation which could possibly
be useful is glRotate(angle, 0,0,1);

> Doing it with cube map seems pretty straightforward.
> Only problem is - I'd prefer to do it without using extensions.


Cube map is among the most widely supported extensions:

http://www.delphi3d.net/hardware/extsupport.php?extension=GL_ARB_texture_cube_map


-- 
<\___/>
/ O O \
\_____/  FTB.    For email, remove my socks.

In science it often happens that scientists say, 'You know
that's a really good argument; my position is mistaken,'
and then they actually change their minds and you never
hear that old view from them again.  They really do it.
It doesn't happen as often as it should, because scientists
are human and change is sometimes painful.  But it happens
every day.  I cannot recall the last time something like
that happened in politics or religion.

- Carl Sagan, 1987 CSICOP keynote address

0
Reply fungus 7/6/2006 11:43:46 AM

fungus wrote:

> The only transformation which could possibly
> be useful is glRotate(angle, 0,0,1);

That's exactly what I was thinking is obvious. But when trying:

....
glMatrixMode( GL_TEXTURE );
glPushMatrix();
glLoadIdentity();
glRotatef( time, 0, 0, 1 );
glMatrixMode( GL_MODELVIEW );
drawObject();
glMatrixMode( GL_TEXTURE );
glPopMatrix();
glMatrixMode( GL_MODELVIEW );
....

I can still see the black areas sliding in. There must be some catch to it.


> 
> Cube map is among the most widely supported extensions:
> 

Yes I'll probably end up doing it that way but I'd still like to resolve 
the sphere map approach just to clear things out.
0
Reply Mirko 7/6/2006 12:02:01 PM
comp.graphics.api.opengl 7097 articles. 24 followers. Post

5 Replies
224 Views

Similar Articles

[PageSpeed] 20


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

tracking a moving object from multiple moving objects
Hello I am new in matlab and i have this problem.I would like to track a moving object from multiple moving objects in a video like the demo with the tracking cars.I want to do this in simulink.How can i choose this specific objects? "Eleftheria " <vileda84@yahoo.gr> wrote in message <ff56bu$huv$1@fred.mathworks.com>... > Hello I am new in matlab and i have this problem.I would > like to track a moving object from multiple moving objects > in a video like the demo with the tracking cars.I want to do > this in simulink.How can i choose this specific objects? ...

moving to objects / IDL objects and object graphics
I'm trying to get a feel for object programming in IDL. I'm reading the last chapter of David Fanning's book on the subject. Here's what I'm wondering: I like the object graphics system in IDL. I also like the concept of writing my own objects. For example, I currently have a widget program containing a draw window. The draw window is set to object graphics mode. I define an IDLgrView object and in the view I place an IDLgrImage object. The data that I'm working with isn't an image, however, it's a movie. What if I were to create my own MBgrMovie object?...

Align objects to a first object without the first object moving
I have several objects on a front panel that I want to align with one another.&nbsp; One object should keep its original position and the others should be aligned to it.&nbsp; Is there a way to do this?&nbsp; The normal method of alignment seems to move all the objects, including the one that I want to retain its original position.&nbsp; I tried locking the object that isn't supposed to move, but then I can't seem to align to it anymore. &nbsp; Darin If you want to align them to a side (top, bottom, left, right), make sure the base object is the outermost in that d...

Move semantics and moved/empty objects
Following a discussion I had on the boost-devel mailing list [1] about objects that can never be empty/null, I started thinking about issues that move semantics introduce. [1] http://article.gmane.org/gmane.comp.lib.boost.devel/177969 Indeed, when moving an object, it is required to leave the object in a state which is at least valid enough to call its destructor on. In the following, let's only consider objects which own resources that must be freed in the destructor. The moved object is then left in an empty state, which might contradict the invariants of the type. However, it could ...

Moving object detection with a moving camera
Hi everyone, I need some help with my university project. It’s about dynamic object detection with a moving camera. I've installed a camera to a potentiometer. My inputs are thus the angular velocity of the camera and the accompanying picture. My idea was with the Computer Vision Toolbox "optical flow" to determine the speed and compare it with my camera speed, so to find out what objects have different speed as the camera itself. The results should be the dynamic objects. My question is what kind of speed (unit) is from the optical flow? I cannot find anything in the Mathwo...

Moving objects
After several months of using PSP 8.1, trying to move objects with shift/control arrows has stopped working. No response. Tried re installing etc. I can move objects with the mouse but not with the KB. Used to work fine! Any suggestions? Go into customize and reset your keyboard shortcuts. "Symon Long" <longs@mersinet.co.uk> wrote in message news:1085521186.387821@news.linix.co.uk... > After several months of using PSP 8.1, trying to move objects with > shift/control arrows has stopped working. > No response. Tried re installing etc. I can move objects with the mous...

Moving objects
Hi, i have the following functions : DrawGLScene() { DrawObjects() SelectObjects() } SelectObjects() { ... if(hists>0) {moveobject from (0,0,0) to (1,2,1)} ... } The problem is this function "moveobject" that i don't know how to write, as all objects are written in DrawGLScene(). I just have to move the selected object, must i use a global variable to say in DrawGLScene() that one object must move ? what should be the method, please ? Regards. Jean-Fran�ois GAZET wrote: > > SelectObjects() > { > ... > if(h...

moving an object
Hi, Can somebody direct me to a link where is explained how to let an object move from 1 place to another? So far I've only found links on rotation. I'm using C on Slackware 10.0 Thanks, Huub Try searching for "translation" Tim wrote: > Try searching for "translation" I thought translation is not meant for moving along a path. Sorry for being not clear enough. Huub wrote: > Tim wrote: > >> Try searching for "translation" > > I thought translation is not meant for moving along a path. Sorry for > being not clear enough. ...

moving object
hai all, how to convent a continuous video into many frames? saigitha ...

How do I insert the coordinates (centroid) of detected moving objects onto the object?
This is for Simulink. I am trying to figure out how to insert the x,y coordinates of the centroid of moving objects that were detected in a video from a webcam. (Down the road, if possible I will like to be able to separate the x and y with a comma.) Right now I can put a bounding box around the detected objects. Using the &#8220;Draw Markers&#8221; block, I can also indicate the location of each object&#8217;s centroid. I am thinking that the way to insert the coordinates is to use the Insert Text block but I am not having any luck doing so. The Insert Text block has...

Moving Objects
Hi I want to be able to move an image around a GUI with the push of 4 directional buttons. Im currently calling a function that creates and axes with a position variable that is updated ie function axes1 global OBJECT AXES x1 y1 AXES(1) = axes('Parent',OBJECT(1),'unit','normal','Position',[x1 y1 0.5 0.5,'Tag','axes1','Visible','on'); and then redrawing it everytime the function is called. Is there a way to move an object without closing and recreating it? Thanks in advance for any advise bob SNIP> wants to move the axes obje...

object moved
while i'm surfing i get very regularly the opening screen " object moved ", with under that " this object may be foud here " with ' here' underlined so i can click on it and i get redirected to the page i wanted to visit in the first place. anyone got an idea , i'm running xp home edition with norton security antivirus ( maybe its got something to do with norton ? ) thxs all ...

object moved
while i'm surfing i get very regularly the opening screen " object moved ", with under that " this object may be foud here " with ' here' underlined so i can click on it and i get redirected to the page i wanted to visit in the first place. anyone got an idea , i'm running xp home edition with norton security antivirus ( maybe its got something to do with norton ? ) thxs all ...

Moving objects
After several months of using PSP 8.1, trying to move objects with shift/control arrows has stopped working. No response. Tried re installing etc. I can move objects with the mouse but not with the KB. Used to work fine! Any suggestions? Go into customize and reset your keyboard shortcuts. "Symon Long" <longs@mersinet.co.uk> wrote in message news:1085521186.387821@news.linix.co.uk... > After several months of using PSP 8.1, trying to move objects with > shift/control arrows has stopped working. > No response. Tried re installing etc. I can move objects with the mous...

multiple behaviors on multiple objects / move everything and if picked only one object
Hello everyone, I`m having great trouble by programming the following: We are programming a miniature golf-game at university. We want to enable the user to rotate, zoom and translate everything he sees at once. We did this with an OrbitBehavior. As far as I know an OrbitBehavior cannot be limited to angles and zoomfactor, is that right? Because later we want to limit the zoom and the user shoudn`t be able to look beneath the ground. The other thing is an arrow, which we want to use for the drive. The user should rotate it around one axis to set the direction. And the size of t...

Gravity slows light, why not the clocks inside 1971 plane experiment? I believe Gravity slows light and other moving objects, *****and by a *PERCENTAGE* factor of the object's velocity? I'm **
Gravity slows light, why not the clocks inside 1971 plane experiment? I believe Gravity slows light and other moving objects, *****and by a *PERCENTAGE* factor of the object's velocity? I'm ***NOT*** talking about "gravity time dilation" which is based only on the distance (height) of the object from the center of the Earth.... INSTEAD I'm talking about the SAME HEIGHT (thus th... 25 Mar 2005 08:32 "http://alexslemonade.org @ http://MeAmI.org" wrote: > > Gravity slows light, why not the clocks inside 1971 plane experiment? > I believe Gravity slows li...

Move object with a for loop
Hello, I am completely new to javascript and am trying to create a function that will move a textbox 250px to the left and 250px to the right, using a for loop. I can't figure out how to add the i value to the top and left values. Below is the code. Can somebody please help? Thanks in advance. Regards, A. Crawford <html> <head> <script type="text/javascript"> <!-- function moveit() { for(i=0;i<=50;i=i+10){ counter.cffield.style.top += i + 'px'; counter.cffield.style.left += i + 'px'; } } //--> </script> </head> <...

Moving multiple objects
Hi, Excuse my "noobiness". I'm trying to get to know LW8 better. Layout: I'm having problems moving multiple objects. I have 15 objects in a row. I clone them once and want to move the clones above the others. I.e. Y-500mm. How do I do that? Using "Add to position" or numeric input only moves one object. If I drag them, all of them moves, but it's impossible to do it precisely enough by hand. Also, I suspect there's an easier way of placing X copies of the same object at exactly some interval. Like making a grid and automatically placing an objects at ea...

how to detect the moving object
Sir am doing a project on image processing .The project is about estimating the speed of moving vehicles(car,truck,bike,van) using traffic cameras in road we can find many objects and human beings moving i don't know how to track only the moving vehicles like car,trucks etc without considering the other moving objects in roads can u pls help me out by suggesting the algorithm and coding.....thanks in advance sir ...

Label of moving object
I want to track object using image processing. when i'm using background substraction method i can get the moving object but how can i label them? i mean to calculate how many object are there on the screen. do i have to use roi ? or is there any other method i can use? On Jan 16, 10:47=A0am, "Teoh " <lirent...@hotmail.com> wrote: > I want to track object using image processing. when i'm using background = substraction method i can get the moving object but how can i label them? i= mean to calculate how many object are there on the screen. do i have to us= e r...

tracking a moving object
I am trying to track the locations of where an object has been by using find but I don't know how to get the difference from successive 'frames'. % Square object moving around % numframes = 10; for k = 1:numframes % Initialise a 400 x 400 grid image_red = zeros(400); image_green = image_red; image_blue = image_red; % Starting point of coloured object r = round(rand*200)+50; c = round(rand*200)+50; % Red square object of size 40 x 40 image_red(r:r+39,c:c+39) = 1; % Concatenation of the colour planes final = cat(3, image_red...

When to pass on environment object?
So unless I missed any, the list below are all the functions that take an environment object as an argument. It seems to me that whenever one calls one these functions from code that is computing a macro expansion, one should pass the environment object that was "passed" to the macro (via a &environment parameter). Is that right? Or are there situations where one would want the compile-time computation to use the null lexical environment instead of the compile-time environment? MACRO-FUNCTION GET-SETF-EXPANSION COMPILER-MACRO-FUNCTION MACROEXPAND-1 MACROEXPAND CONSTANTP MAKE-LO...

tracking the moving objects
hi,i m doing a project in image processing,i need to extract frames from a video and track the moving objects.... i'm using background subraction method... could anyone pls help me with the code "harshini harshini" <harshini@yahoogroups.com> wrote in message <h41eie$arc$1@fred.mathworks.com>... > hi,i m doing a project in image processing,i need to extract frames from a video and track the moving objects.... i'm using background subraction method... could anyone pls help me with the code Hi! You can't expect a code for some application..... You try implem...

moving objects in a graph
Dear all, I plotted several curves in separate figures and want to creat stact curves in a single figure. But they all have the same x and y offset. How can I move them so that they are different x, y offsets? I tried the "unlock axes position", but there is no handles on the object and I can not move the object. I appreciate your help! Charles charles2 <c.onestone@lycos.com> wrote in message news:<eee016b.-1@webx.raydaftYaTP>... > Dear all, > > I plotted several curves in separate figures and want to creat stact > curves in a single figure. But they all ...