x3d blending textures transparent - x3d

I want to blend two textures, each with specified opacity, follwing is my imaginary code. (no surprise it won't work)
<appearance>
<ImageTexture url="texture1.jpg" opacity="0.7"></ImageTexture>
<ImageTexture url="texture2.jpg" opacity="0.3"></ImageTexture>
</appearance>
Looks like it might have something to do with MultiTexture or BlendMode, but I haven't figure out how it works yet.

I just realize an appearance node can have both texture and material properties at the same time, so the following works perfectly fine to me.
<shape>
<sphere></sphere>
<appearance>
<ImageTexture url="texture1.jpg"></ImageTexture>
</appearance>
</shape>
<shape>
<sphere></sphere>
<appearance>
<material transparency="0.3"></material>
<ImageTexture url="texture2.jpg"></ImageTexture>
</appearance>
</shape>

Related

Correctly Syncing Material-UI Tab component with React Router and Nested Tabs

I have been reading a lot of past questions and answers as well as experimenting continuously, but I feel like I might be barking down the wrong path...
If I had a page that contained tabs like so:
<Tabs value={location.pathname.substring(location.pathname.lastIndexOf('/') == -1 ? 0 : location.pathname.lastIndexOf('/'))}>
<Tab label="Tab 1" value='/tab1' />
<Tab label="Tab 2" value='/tab2'>
<Tab2Contents />
</Tab>
</Tabs>
function Tab2Contents(){
return (<Tabs value={location.pathname.substring(location.pathname.lastIndexOf('/') == -1 ? 0 : location.pathname.lastIndexOf('/'))}>
<Tab label="Detail" value='/detail' />
<Tab label="Info" value='/info'>
<Tab2Contents />
</Tab>
</Tabs>)
}
This may work on a simplistic case however if the path structure gets deeper so it's no longer just:
http://somewebsite/home/tab2
Rather Tab2Contents ends up having a list of items, and when you click on the item it shows details of the item grouped in another set of tabs which will yield a path structure like:
http://somewebsite/home/tab2/details
Obviously the Main set of tabs (Tab1, Tab2) would no longer match correctly.
Is there anyway to actually solve this at all? Every solution online seems to require the tab click handling to set states, but it obviously doesn't work too well if someone was to navigate to that url, it would expect both the Home page's Tab's would be highlighted along with the Details Tab.

Call a method on switching between lightning tabs in salesforce using LWC

I have 3 lightning tabs. I want to run a particular piece of code on switching between these tabs. Is there a way I can do it. I tried writing the code in renderedCallback and connectedCallback, but none of these methods are called on switching between tabs.
You could add onactive in your markup
<lightning-tabset active-tab-value={activeTab}>
<lightning-tab label="Item One" onactive={handleClick} value="one">
One Content !
</lightning-tab>
<lightning-tab label="Item Two" onactive={handleClick} value="two">
Two Content !
</lightning-tab>
<lightning-tab label="Item Three" onactive={handleCLick} value="three">
Three Content !
</lightning-tab>

Modifying Code Output by a React Component

I am using a React library which outputs an svg-icon. I would like to style that icon using linear-gradients. To do so, I need to modify the code that is output. Here is a simplified schema showing what I would like to change
Current Output
<svg>
<path></path>
</svg>
Desired Output
<svg>
<defs>
<linearGradient>
<stop />
<stop />
<linearGradient>
</defs>
<path></path>
</svg>
In other words, I need to some code inject into the svg tags that get output.
Is it possible to do this with React? If so, how?
Thanks.

Why circle doesn't update?

Why the circle doesn't change his radius?
plunker: [http://plnkr.co/edit/OlgflYVVXkPQPsbzc1q1?p=preview][1]
aaaaaaa
aaaaaaa
The problem is, that the angularjs-google-maps directives are not updating, even when the values of the radius attribute are changing. I guess you already took a look into the attributes as well and saw, that even when the radius was growing the entire <shape> wasn't updating its appearance.
Due to this question and answer How to re-render a template in an Angular directive? I was able to rerender the shapes with the help of that directive.
So wrapping the directive around the <shape></shape>
<div relink-event="radiusUpdated">
<shape name="circle" ng-repeat="post in posts" stroke-color="#FF0000" stroke-opacity="0.8" stroke-weight="1" fill-color="#FF0000" fill-opacity="0.35" center="{{post.location}}" radius="{{post.postRadius*1000}}">
{{post.postRadius}}
</shape>
</div>
And broadcasting the radiusUpdated in your $interval function now updates the shape in your map. I doubt that it is a very high performant way to do this (imagine to rerender hundreds of posts every two seconds), but maybe it is working in your case.
Here is a working Plnkr: http://plnkr.co/edit/j0nO6MUCpf0Px2QwkKD1?p=preview
Would be nice if you upvote the refered answer by SO user rob as well ;).

Why submit called from inside of panelCollection doesn't submit data changes from the rest of page

My application is build using Oracle ADF 11gR1 (JDeveloper 11.1.1.7.0), and I have a problem with data submitted by commandLink placed inside of panelCollection.
I have following page fragment structure:
<af:panelAccordion id="pa1">
<af:showDetailItem id="sdi1">
<af:panelFormLayout id="panelFormLayout1">
<af:inputText value="#{bindings.C11.inputValue}" id="it34" />
<af:inputText value="#{bindings.N04.inputValue}" id="it32" />
<af:selectOneChoice value="#{bindings.N13.inputValue}" id="soc4" autoSubmit="true" >
<f:selectItems value="#{bindings.N13.items}" id="si4"/>
</af:selectOneChoice>
...
</af:panelFormLayout>
<af:showDetailItem>
...
<af:showDetailItem id="sdi4">
<af:panelCollection id="pc2">
<af:table value="#{bindings.Table.collectionModel}"
var="row" rows="#{bindings.Table.rangeSize}"
filterModel="#{bindings.Table.queryDescriptor}"
queryListener="#{bindings.Table.processQuery}"
varStatus="vs"
selectedRowKeys="#{bindings.Table.collectionModel.selectedRow}"
selectionListener="#{bindings.Table.collectionModel.makeCurrent}"
rowSelection="single" id="t2">
<af:column id="c19">
<af:commandLink id="cl1" textAndAccessKey="#{row.bindings.C0.attributeValue}" actionListener="#{pageFlowScope.Bean.handle}"/>
</af:column>
<af:column id="c17">
<af:inputText value="#{row.bindings.C1.inputValue}" id="it17" />
</af:column>
<af:column id="c16">
<af:inputText value="#{row.bindings.C2.inputValue}" id="it42" />
</af:column>
...
</af:table>
</af:panelCollection>
</af:showDetailItem>
</af:panelAccordion>
CommandLink (id="cl1") placed in table column c19 has defined actionListener. Method of this performs operation which base on data given in selected row in table and in controls from panelFormLayout above.
When commandLink is pressed, and actionListener method fired, I see (in the results and in debug) that data changes from panelFormLayout are not submitted, except the ones which has autosubmit set to true. But if I place the same commandLink outside of panelCollection all data are submitted.
My question is how I can force submit of data from whole pageFragment when actionListener is fired from panelCollection inside?
Autosubmit on all controls outside of panelCollection doesn't seem to be a good solution because of many uncessary POST requests.
The reason for this behaviour is the had optimised lifecycle which is used for some components including table and panelAccordion. His means that the values are only submitted inside the boundary of the component. In your case it means that only the showDetailItem is submitted.
To submit the form to you have to set the id if the link as partial trigger to the form.
A detailed description can be found in this presentation http://de.slideshare.net/mobile/stevendavelaar/18-invaluable-lessons-about-adfjsf-interaction in lesson 17
Perhaps try putting the panel collection inside a subform?

Resources