Start a new topic
Solved

realtive location not showing imagedrawable

Do you see anything wrong with the code below - I verified the ImageResource url is valid


function CouponMarker() {

 

var couponLocation = new AR.RelativeLocation(null, 1, 1, 100);

 

 

var markerDrawable_coupon = new AR.ImageResource(cdnUrl + World.target + "/assets/coupon.png");

 

this.markerDrawable_Coupon = new AR.ImageDrawable(markerDrawable_coupon, 5, {

        zOrder: 2,

        opacity: 1.0

    });

 

 this.markerObject = new AR.GeoObject(couponLocation, {

        drawables: {

            cam: this.markerDrawable_Coupon

        }

    });

 

  return this;

}


Just creating of object of this type should put the Image in front of the user right? 

I created 20 POIs using your marker class. I later call a function that creates this relative location with a drawable. I verified that the CouponMarker code is called at the appropriate time. Is there something else I need to do? DOesn't the creation of the AR.GeoObject case the drawables to be rendered? 


Thanks



Hi Wilson,

The easier thing for me would be for you to tell me what is your use case, so what it is you wish to achieve, so that I can then advice you.

Thanks
Eva

 

I don't really have a use case, I was just testing various capabilities of Wikitude. I used one of your examples to create 20 POIs. After 3 POIs are clicked in succession I execute the following code:


myRelativeMarker = new CouponMarker(); isn't that sufficient, based on the code above to display the imageDrawable?


Andy 

Hi Wilson,

I am afraid I still do now exactly understand what it is you are trying to achieve here. Do you want to select 3 POIs and then show an image as an augmented object? If you can give me more details then I will know how I can help you to achieve what you wish.

Thanks
Eva

 

yes that is exactly what I want to do. I just want to display an image drawable at a relative location (relative to the user).


Thanks

Hi Eva,


I finally got it working. The problem was I didn't understand the Northing and Easting parameters so the image wasn't showing up where I expected it to and the scale was so small that it was almost invisible. Sorry to waste your time and thanks for your attempts to help me


Andy

Hi,

No worries ;) I am glad you managed to make it work!

Thanks
Eva

 

Login or Signup to post a comment