Metaio SDK (AREL) - how to show image content without tracking? - arel

I have just simple rectangle button realized as image content and i wanna to show it on screen without any tracking and without using screen anchors.
You can see i have no translation and rotation, but screen is still empty.
<object id="button1">
<title><![CDATA[Button 'images']]></title>
<assets3d>
<model><![CDATA[html/resources/0cde94934f9b4dab0998a3d73b2865ba/0cde94934f9b4dab0998a3d73b2865ba.zip]]></model>
<transform>
<translation>
<x>0.0</x>
<y>0.0</y>
<z>0.0000000000</z>
</translation>
<rotation type="eulerdeg">
<x>0.0000000000</x>
<y>0.0000000000</y>
<z>0.0000000000</z>
</rotation>
<scale>
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</scale>
</transform>
<properties>
<coordinatesystemid>0</coordinatesystemid>
<screenanchor flags="4">0</screenanchor>
</properties>
</assets3d>
<viewparameters/>
</object>

You can use Dummy-Tracking: http://helpdesk.metaio.com/questions/7548/explanation-on-dummy-tracking
In general the best place to ask questions about AREL or the metaio SDK is http://helpdesk.metaio.com
There you should get an answer quickly.

I think that the problem is here:
<scale>
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</scale>
The 0.0 is not a neutral scaling value.Your scaling transformation results in an object with no dimension. As it is shown on http://www.advancedmetaio.com/explaining-the-arel-xml-structure-part-2-transformations/, if you don't want to apply any scaling transformation your scaling values should be (1, 1, 1) :
<scale>
<x>1.0</x>
<y>1.0</y>
<z>1.0</z>
</scale>

Related

Logo is not fitting in the specified dimension container in pdf using apache velocity template

#macro(logoLiveAreaSection)
<fo:block-container width="52mm" height="18mm" position="relative">
<fo:block position="absolute" top="0" left="0">
$liveArea.render("logo_live_area")
</fo:block>
</fo:block-container>
#end
I am trying to fit the new logo in container in pdf but it is coming out of that specified size, it should be fit within (52x18)mm space
Any suggestion, What should be done to solve it?
I am using this code
I tried using overflow property but no luck
another way to insert logo is to set a variable and specify your file
#set ($logo1Url="url('file:/data/logos/yourlogo.png')")
And you can use your variable in the code below
<fo:inline >
<fo:external-graphic src="$logo1Url" content-height="64px" content-width="64px"/>
</fo:inline>
external-graphic is used for a graphic where the graphics data resides outside of the XML result tree.
To specify size, use content-height and content-width.
Documentation is available here

Lower quality images in Next.js "Image" vs. normal "img" tag

I'm working with Next.js, and for some reason my images are looking somewhat blurry when I use Next/Image.
Here's what my code looks like:
<img src={url} width={articleWidth} />
<Image
className="text-center"
src={url}
alt={alt}
width={width}
height={height}
/>
Here's what the images look like (it might be a bit difficult to tell but the Next/Image version is clearly blurrier on my monitor).
A few other pieces of info I noticed
The version using the img tag had an intrinsic size of 2016 x 1663 and the version using Next/Image had an intrinsic size of 750x615
How do I make Next/Image images look just as clear as my regular img component
Next.js creates versions of your image on run time and serves the apt sized image to render.
If you want to opt out of it:
You can selectively use the unoptimized prop:
<Image
className="text-center"
src={url}
alt={alt}
width={width}
height={height}
unoptimized
/>
or,
Using the unoptimized option in next.config.js:
module.exports = {
images: {
unoptimized: true,
},
}
When above is set true images will be served as is, without any size change.

Maker Based AR.Js and A-Frame - Visual Problem, Clipping Mesh

enter image description here
The White Mesh bellow Clips through the roof and the further you move the object, the worse it gets.
Piotr Adam Milewski answered this question, from another person and gave this solution:
https://stackoverflow.com/a/63143382/18310645
But i don't understand a thing about coding so i don't know how to implement it in my code, can someone help me?
Here is my code:
<!DOCTYPE html>
<html>
<script src="https://aframe.io/releases/1.0.0/aframe.min.js"></script>
<script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
<body style="margin: 0px; overflow: hidden">
<a-scene embedded arjs>
<a-marker preset="hiro">
<a-entity
position="0 0 0"
scale="0.2 0.2 0.2"
gltf-model="https://cdn.glitch.global/0653babd-a1b3-490a-9927-4d95dd7c9ffa/Capela%20das%20Penhas.glb?v=1645748288220"
></a-entity>
</a-marker>
<a-entity camera></a-entity>
</a-scene>
</body>
</html>
If Your model looks properly in the gltf-viewer, but with ar.js You're experiencing clipping like this:
it is very likely, that you need to use a logarithmicDepthBuffer in your renderer.
Luckily, it's very easy - just add the renderer component to the <a-scene> element with the desired property:
<a-scene embedded arjs renderer="logarithmicDepthBuffer: true">
Which should result in a more desired image:
Check out both proper and clipping models here
Why is it happening? The model looks small, but actually it's huge just rescaled (100times, from what sketchfab exporter gave me). Also the marker makes it even more rescaled (marker determines the unit size. The <marker> content is rescaled from 1m to whatever the print size).
If we'd lose the scaling, the model would be so huge, the clipping parts would be so far away, that determining their precise distance from the camera would be wasteful. So you need to switch to a logarithmic depth buffer, which is designed to have better precision for greater distances.
Model by Boooooop

How do I set AG-Grid's height to automatically match the data content height?

I'm trying to get ag-grid's height to match the content.
I have several sets of data which I'm trying to load into different grids, each with the appropriate height for the data.
There is an AutoHeight option but the Angular version doesn't seem to work (I'm assuming this is for a previous version).
Here is my alternative attempt, which doesn't work:
<ng-container *ngFor="let reportItem of reportData">
<br />
<ag-grid-angular style="width: 100%; height: {{ 560 + (reportItem.data.length * 40) }}px;"
class="ag-theme-material bold-headers"
[rowData]="reportItem.data"
[columnDefs]="columnDefs">
</ag-grid-angular>
</ng-container>
Does anyone have a better suggestion?
Rather than just linking to the Auto-Grid Height method I described at the top - which I tried and failed with, could you please explain how I should implement it with my code above? (as I accept I may have missed something)
Thanks
There is the setGridAutoHeight method available on the api object. You need to get a reference to that object from the gridReady event and then you can call it, passing true to it. You have to take care with it if your data has many rows because using this method all the rows will be rendered to the DOM, normally only the visible ones are rendered.
gridApi.setGridAutoHeight(true)
It's at the bottom of the page: https://www.ag-grid.com/javascript-grid-api/
according to this link you can use domLayout='autoHeight' as a property to your grid.
it worked for me.

Making Image Clickable in Flex Mobile Project

I want to make an image clickable/tap , so when the user clicks/taps it a sound can be played.
I,m working on flex SDK version 12 and using s:BitmapImage for images.
s:BitmapImage is a primitive component that doesn't support interactivity.
If you want interactivity, you need to use a component that extends InteractiveObject.
Use s:Image instead.
s:Image is also skinnable, giving you a lot more flexibility. Of course the footprint will be heavier than that of s:BitmapImage, so I would recommend still using s:BitmapImage when you don't require the extra functionalty.
BitmapImage does not support touch events, but you can put it into a Group:
<s:Group click="zoomAvatar(event)">
<s:BitmapImage id="_avatar"
width="{AVATAR_WIDTH}"
height="{AVATAR_HEIGHT}"
scaleMode="letterbox"
source="{male_happy}"
contentLoader="{AVATAR_CACHE}" />
</s:Group>