Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / 3d object plain ... retexture using xy screen coordinates

Author
Message
haliop
User Banned
Posted: 28th Apr 2013 07:36
hello again

so some time ago i used Dgdk .. and i was able to retexture 3d objects using my mouse what do i mean ..
like for example blood splatters ... if i shot an enemy .. his blood splatter on the wall behind him and stay on the wall texture .. ive done it with memblocks images and i think memblocks 3d objects..

but i think AppGameKit dosenot posses such power i might be wrong..
can you enlighten me ?

ty for your time

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 28th Apr 2013 09:23 Edited at: 28th Apr 2013 09:26
you need line-poygon intersect,
camera position>object.
you don't get the obj surface itself but you can make a blood sprite
at ray hit position.
you can add the normal or multiply the normal with a value and
add it to RayCastX y z to move them a little bit back.

(if you use InstanceObject for walls, they share the texture)

useful functions:
Get3DVectorXFromScreen
Get3DVectorYFromScreen
Get3DVectorZFromScreen
GetScreenXFrom3D
GetScreenYFrom3D
GetCameraX
GetCameraY
GetCameraZ
SetObjectCollisionMode
ObjectRayCast
ObjectSphereCast
GetObjectRayCastNumHits
GetObjectRayCastSlideX
GetObjectRayCastSlideY
GetObjectRayCastSlideZ
GetObjectRayCastX
GetObjectRayCastY
GetObjectRayCastZ
GetObjectRayCastNormalX
GetObjectRayCastNormalY
GetObjectRayCastNormalZ
SetObjectLookAt( objID, x, y, z, roll )
haliop
User Banned
Posted: 28th Apr 2013 10:11
awesome! ty very much for your help will check in to it right away!

haliop
User Banned
Posted: 30th Apr 2013 19:52
can someone write a quick example as i dont have time to master AppGameKit , got alot of stuff going on..

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 30th Apr 2013 20:51
here
you need two images.

haliop
User Banned
Posted: 30th Apr 2013 21:59
aha very nice but not exactly what i wanted
what i want is to paint with raycast on the object texture..
i think a memblock is needed..

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st May 2013 10:06 Edited at: 1st May 2013 10:07
i can't find a way to get the polygon list from a object
because you need the intersected surface triangle to get the uvs.
(the 3d part is not finished.)

if you make your walls with simple planes its maybe possible
but then each have a own texture, that cost to much memory.

my idea is to exchange the wall texture with the same but
with blood splatter. means exchange the texture image.
haliop
User Banned
Posted: 1st May 2013 12:24
yep.. i'll use only plain objects for this and build the boxes of 6 plains..
so any example on how to do it?
it will mean alot to me and will be credited in app ofcourse!

haliop
User Banned
Posted: 1st May 2013 12:29
and it wont take too much memory since you only looking at some walls and not the entire map... so its LOD and DOD...
you know you guys are so afriad AppGameKit will consume alot of CPU and GPU power if its a big project on mobile devices.. but why do you keep forgetting that iPhone 4 have for say a decent CPU/GPU ... iPhone 4s have better... not to mention 5 .. and 6? .. maybe 7 ?
however you look at it.. devices are always getting stronger!
even if you release an app for high end devices only .. there would be men and women who will buy the app .. if you have an exclusive app a good app for a spechific mobile device.. then you are even better cause now you can get intouch with the manufactor of the mobile device and make a deal with him.. sell your app in thousands.. as long as its good enough and exclusive for one product..

just build what you dream off.. tweak it later for slower devices maybe remove some features .. but do not take devices limitations as your coding limitations.. cause if so .. we would be stick with PS 1.. just dream guys and lads.. the devices will come later on and will be stronger not to even mention that AppGameKit will become stronger in time also .. more powerful and faster.

Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st May 2013 13:05 Edited at: 1st May 2013 13:10
hmm, i missing getobjectimage()^^
haliop
User Banned
Posted: 1st May 2013 13:06
haliop
User Banned
Posted: 1st May 2013 13:08
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 1st May 2013 13:11 Edited at: 1st May 2013 13:11
something like this
haliop
User Banned
Posted: 1st May 2013 13:14
actually look at that if you do a type for each object..


you could find the image attached very quickly

haliop
User Banned
Posted: 1st May 2013 13:15
yep that should work..
only that now i need the exact x,y point of the Object to draw it exactly there..

haliop
User Banned
Posted: 1st May 2013 13:19
so actually i can take your code from before.. with the raycast.. keep the objectplain with the blood splatter (the new one created) there..
then when this objectplain timer is due.. i can repaint the wall texture behind it and remove the bloodsplatter objectplain..
something like this .. this also means that if there are too many splatters objects.. they will be removed from time to time.. as theyre delay... and when they move the blood will stay on the wall but instead of an object just as inside the wall object texture..

Login to post a reply

Server time is: 2024-11-24 13:25:17
Your offset time is: 2024-11-24 13:25:17